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

Mark McEahern marklists@mceahern.com
Wed, 3 Apr 2002 09:55:48 -0600


[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