list.pop(0) vs. collections.dequeue

Terry Reedy tjreedy at udel.edu
Sat Jan 23 18:08:37 EST 2010


On 1/23/2010 2:02 PM, Roy Smith wrote:
> In article<Xns9D09A7BCC6698duncanbooth at 127.0.0.1>,
>   Duncan Booth<duncan.booth at invalid.invalid>  wrote:
>
>> Roy Smith<roy at panix.com>  wrote:
>>
>>> I'm looking at http://tinyurl.com/cdbwog.  It shows all the operations
>>> of a list.  What it does not show is their cost.  For pop(), it has a
>>> note:
>>>
>>> "The pop() method is only supported by the list and array types. The
>>> optional argument i defaults to -1, so that by default the last item
>>> is removed and returned".
>>
>> The page you should probably be looking at is
>> http://wiki.python.org/moin/TimeComplexity
>
> I was not aware of this page; thanks for pointing it out.

Perhaps you could suggest on the tracker a place or places in the doc 
where this relatively new wiki page could be referred to. Perhaps in the 
introductory paragraphs of the Built-in Type section of the lib ref. 
Where would you have like to have found it?

The page was added in response to threads like this one, but it 
obviously is more obscure than it should be.

Terry Jan Reedy





More information about the Python-list mailing list