Abuse of the object-nature of functions?

Fredrik Lundh fredrik at pythonware.com
Tue Jul 11 11:20:46 EDT 2006


Peter Otten wrote:

> You would normally expect that you can turn off a flag by setting it to
> False instead of deleting it -- which is also how the OP's code works. So I
> would prefer
>
> assertion = getattr(callable, "is_assertion", False)

agreed (but note that the OP used a decorator to set the attribute, so you could
consider it an implementation detail...)

</F> 






More information about the Python-list mailing list