pop() clarification

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Thu Apr 12 03:05:35 EDT 2007


Hamilton, William a écrit :
>> -----Original Message-----
>> From: python-list-bounces+whamil1=entergy.com at python.org
> [mailto:python-
>> list-bounces+whamil1=entergy.com at python.org] On Behalf Of Scott
>>
>> I understand all that.  What I don't understand is why all the
>> documentation
>> I see says, "When removing a specific element from a list using pop()
> it
>> must be in this format: list.pop([i]).
>> At first I took that to mean that list.pop(i) would return some type
> of
>> error, but it doesn't.
>> I can't find any documentation saying that this rule that I keep
> reading
>> about (again list.pop([i]) ) is the only format to use when removing a
>> specific element because......with the explaination to follow.
> 
> I believe that the [i] notation is to indicate that it has to be a valid
> index to your list.

And you're wrong. Well, it has to be a valid index, but this has nothing 
to do with the notation used. Google for "Backus-Naur Form"...




More information about the Python-list mailing list