What is not objects in Python?
greg
greg at cosc.canterbury.ac.nz
Sat Oct 4 21:25:56 EDT 2008
Marc 'BlackJack' Rintsch wrote:
> On Fri, 03 Oct 2008 19:10:27 +1200, greg wrote:
>>(BTW, try doing that with the x.len() notation!)
> def size(obj):
> return obj.len()
>
> or
>
> size = operator.methodcaller('len')
No, what I meant was that if the normal way of getting
the len of something were to write x.len() instead of
len(x), you wouldn't be able to globally substitute
that syntax with x.size().
--
Greg
More information about the Python-list
mailing list