PEP 285: Adding a bool type

Martin v. Loewis martin at v.loewis.de
Sat Mar 30 17:00:51 EST 2002


"Terry Reedy" <tejarex at yahoo.com> writes:

> A. This PEP formalizes existing Python practice in regards to truth
> values.  The 'new' type is not really new.  The main visible effect is
> to change the display of the doubleton values.  The existing magic
> method is __truth__().  Better to call the new type and constructor
> truth() than to change __truth__ () to __bool__().

The existing magic method is __nonzero__, and the PEP does not propose
to change it...

Regards,
Martin




More information about the Python-list mailing list