[Python-Dev] Re: PEP 285: Adding a bool type (original) (raw)

Barry A. Warsaw barry@zope.com
Wed, 3 Apr 2002 15:05:13 -0500


"KY" == Ka-Ping Yee <ping@lfw.org> writes:

KY> This doesn't mean anything in practice.  Every yes/no function
KY> i've encountered returns 1 for yes and 0 for no.

Now we see a way out. Rename the constants to Yes and No and add a builtin alias for bool() calld theAnswerTo(). Thus all our conditionals would be written like so:

if theAnswerTo(myQuestion) is Yes:
# do it

truthful-ly y'rs, -Barry