Dave Benjamin wrote:

> Mike Meyer wrote:
>> Dave Benjamin <[EMAIL PROTECTED]> writes:
>> 
>>>Python is actually quite consistent in this regard: methods that
>>>modify an object in-place return None;
>> 
>> Um, no. list.pop comes to mind as an immediate counterexample. It may
>> be the only one...
> 
> I'm sure there are counterexamples... maybe 95% is too optimistic. 
> Anyone want to volunteer to compile some stats? ;)

Well, that's because list.pop mutates a list _and_ returns something 
meaningful (not the list itself).  One could modify the above statement 
about consistency to say that methods which modify an object and do not 
return a directed value do not return the object which was mutated, but 
rather return None.  So list.append returns None, but list.pop returns 
the element popped.

-- 
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
   Nobody's interested in sweetness and light.
   -- Hedda Hopper
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to