Observer-Pattern by (simple) decorator

Peter Otten __peter__ at web.de
Sat Jun 2 12:01:51 EDT 2007


Wildemar Wildenburger wrote:

> Thanks for the thorough explanation. But you did mock me with that
> "SomeActor.meth is SomeActor.meth"-line, right? ;)

Acually, no:

>>> class Descriptor(object):
...     def __get__(*args): return object()
...
>>> class SomeActor(object):
...     meth = Descriptor()
...
>>> SomeActor.meth is SomeActor.meth
False

Peter




More information about the Python-list mailing list