representation of unbound methods - strange behaviour

Skip Montanaro skip at
Wed Aug 18 13:09:52 EDT 1999

>>>>> "Stefan" == Stefan Franke <spamfranke at> writes:

    Stefan> Why does this happen:


    <unbound method A.f> stuff snipped

I believe it is constructing the method name on-the-fly using the names it
finds in the class and function.  It's not using the attribute name.

    >>> class A: pass
    >>> def foo(): pass
    >>> A.f = foo
    >>> A.g = foo
    >>> A.f
    <unbound method>
    >>> A.g
    <unbound method>

Skip Montanaro	|
skip at  |

More information about the Python-list mailing list