move to end, in Python 3.2 Really?

Gregory Ewing greg.ewing at canterbury.ac.nz
Mon Feb 28 19:41:00 EST 2011


Raymond Hettinger wrote:

> The existing list.pop() API is similar (though it takes an index
> value instead of a boolean):
> 
>>>>mylist.pop()                      # default case:  pop from last
>>>>mylist.pop(0)                     # other case:    pop from first

pop() is somewhat different, because there is an infinite
range of possible values for the index parameter.

Here there are only two possibilites, though, and it's
unlikely that code will want to dynamically select between
them -- so the "no constant parameters" guideline would seem
to apply.

-- 
Greg



More information about the Python-list mailing list