I spent 2 hours debugging a mistake in my python code and found this


#1

https://docs.python.org/2/tutorial/datastructures.html (same for v3.7)

list.pop([i])
Remove the item at the given position in the list, and return it. If no index is specified, a.pop() removes and returns the last item in the list. (The square brackets around the i in the method signature denote that the parameter is optional, not that you should type square brackets at that position. You will see this notation frequently in the Python Library Reference.)

list.pop(0) is supposed to remove first element, not the last.
Will have to use list = list[1:] for now.

I have some thoughts about why this happens, but either way, it’s a ridiculous bug to be fixed.


#2

hmmm interesting…
maybe 0 isn’t a valid index for .pop()?
i had the same problem in the queue manager level
in the end, i just flipped the list and it worked.


#3

See this post.


#4

Bryukh opened this issue on 16 Jun 2016

Huh, cool. Guess it’s not gonna be fixed anytime soon.
Thx for the info. Next time I’ll search before posting bugs. I was mad a bit, and just wanted to blow off steam.