There only one puzzle left to solve:

altough the solution I proposed works, this variant has problems:

>>> class Foo:
            name='John'

>>> a=Foo()
>>> def p():
            print 'Hi, %s!'%self.name
>>> a.met=p
>>> a.met.self = a
>>>a.met()
NameError: global name 'self' is not defined

This error is paradoxical since:

>>> a.met.self
<__main__.Foo instance at 0x405ed2ec>

Can anyone explain this?

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to