[Python-Dev] Re: PEP 285: Adding a bool type

Mark McEahern marklists at mceahern.com
Wed Apr 3 10:55:48 EST 2002


[me]
> This is Python with the PEP:
> 
> falseValues = [{}, [], 0, None, False]
> for x in falseValues:
>     if not x:
>         print "%s is 'false'." % x

[Fredrik Lundh]
> can you explain how your second example covers
> everything that's in the PEP?

It doesn't cover everything in the PEP.

Here's how I think of the PEP:

With this PEP, we get to have our cake and eat it too:

	1.  There is one obviously correct way to return a truth value.
	2.  Polymorphous perversity with respect to truth still works.

What's everybody complaining about?

Cheers,

// mark





More information about the Python-list mailing list