I come to praise .join, not to bury it...

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Thu Mar 8 15:19:59 EST 2001


Wed, 7 Mar 2001 14:24:38 -0500, Steve Holden <sholden at holdenweb.com> pisze:

> Surely no type conversion is involved: the interpreter just converts
> 
>     instance.method(*args)
> 
> into
> 
>     class.method(instance, *args)

No. This is what I would like it to do, and proposed a few weeks ago.
A conversion happens during extraction from a class, and only if it's
a function (not function-like object).

If C is a class, then after
    foo = whatever
    C.foo = foo
    foo = C.foo
foo is the same as whatever *unless* it was a function, in which case
it got converted to an unbound method (and can only accept C instances
as the first argument).

If you try to implement a method using a function-like object instead
of a function, it won't work.

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list