What is not objects in Python?

Steve Holden steve at holdenweb.com
Tue Sep 30 13:07:18 CEST 2008


Terry Reedy wrote:
> Steven D'Aprano wrote:
>> On Mon, 29 Sep 2008 05:41:02 -0700, George Sakkis wrote:
>>
>>> For example I would be much less
>>> opposed to len() being defined as, say, |x| if "|...|" was a valid
>>> operator.
>>
>> Arghh! No!!! |x| should be abs(x), not len(x). Just ask mathematicians
>> and physicists.
> 
> It should be both, just as + is addition for numbers and concatenation
> for sequences.  Or we could have just one built-in -- size() instead of
> abs() and len().  For non-sequence collections, size() would be better
> than len() anyway.
> 
And how are these "non-sequence collections" to be distinguished? And
how does size() differ from len() in that case?

regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list