Decorating methods - where do my arguments go?

Mikael Olofsson mikael at isy.liu.se
Mon May 11 12:04:04 EDT 2009


Duncan Booth wrote:

> The __get__ method should be returning a new object, NOT modifying the 
> state of the decorator. As written it will break badly and unexpectedly 
> in a variety of situations:
> 
> [snip good examples of things going bad]

Ouch! So, does that mean that George's solution based on a function is 
the way to go, or does that mean that my __call__ should analyze the 
passed callable?

/MiO



More information about the Python-list mailing list