generators as decorators simple issue

Ramchandra Apte maniandram01 at gmail.com
Tue Sep 11 22:55:24 EDT 2012


On Wednesday, 12 September 2012 07:58:10 UTC+5:30, pyjoshsys  wrote:
> I'm trying to call SetName on an object to prevent me from ever having to call it explictly again on that object. Best explained by example.
>
[snip]
In your decorator, you are using `yield cls` - it should be `return cls` 99.99% of the time.



More information about the Python-list mailing list