Overloading "if object" unary operator

Sarcastic Zombie sarcasticzombie at gmail.com
Wed Nov 29 11:33:53 EST 2006



On Nov 29, 11:26 am, Peter Otten <__pete... at web.de> wrote:
> Sarcastic Zombie wrote:
> > is there any way to overload the 'if' unary usage to detect if a
> > variable has a value?Define a __nonzero__() or __len__() method.
>
> Peter

Thanks to both of you, it worked perfectly. I must have missed it in
the documentation somehow.

-Jason Ledbetter




More information about the Python-list mailing list