Observer-Pattern by (simple) decorator

Wildemar Wildenburger wildemar at freakmail.de
Sat Jun 2 12:11:46 EDT 2007


Peter Otten wrote:
>>>> class Descriptor(object):
>>>>         
> ...     def __get__(*args): return object()
> ...
>   
>>>> class SomeActor(object):
>>>>         
> ...     meth = Descriptor()
> ...
>   
>>>> SomeActor.meth is SomeActor.meth
>>>>         
> False
>   
Of course ...
Man, this language is breaking my head, seriously!  &->


/W



More information about the Python-list mailing list