PEP 285: Adding a bool type

Roy Smith roy at panix.com
Sun Mar 31 09:26:28 EST 2002


martin at v.loewis.de (Martin v. Loewis) wrote:
> Your list of alternatives that reek in comparison was
> puzzling. int(bool(obj)) doesn't reek to me: it is obvious what it
> does, it does that efficiently, and it requires less typing than
> operator.truth(obj).

Seems to me, obj.bool().int() would be the obvious way.



More information about the Python-list mailing list