[Chicago] falsy objects?
Ken Schutte
kenschutte at gmail.com
Fri Mar 19 16:07:22 CET 2010
As others said, "__nonzero__" will do it. The relevant docs are here:
http://docs.python.org/library/stdtypes.html#truth-value-testing
Ken
On Fri, Mar 19, 2010 at 10:04 AM, Brian Ray <bray at sent.com> wrote:
> You probably want to look at truth operator overloading
> http://docs.python.org/library/operator.html
>
> On a side note, you may also want to look into Mock object helpers
> http://python-mock.sourceforge.net/ depending on what your trying to do.
> They are useful on several levels, but the mock library itself needs to do
> things like truth testing.
>
> Brian Ray
>
>
>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> http://mail.python.org/mailman/listinfo/chicago
>
More information about the Chicago
mailing list