What is not objects in Python?

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Fri Oct 3 05:03:08 EDT 2008


On Fri, 03 Oct 2008 19:10:27 +1200, greg wrote:

> But in any case, size-likers have an easy solution:
> 
>    size = len
> 
> :-)
> 
> (BTW, try doing that with the x.len() notation!)

def size(obj):
    return obj.len()

or

size = operator.methodcaller('len')

in Python 2.6 and up.

:-)

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list