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

Mark McEahern marklists at mceahern.com
Wed Apr 3 11:59:49 EST 2002


[Barry A. Warsaw]
> The strongest con for PEP 285 seems to be the natural inclination for
> people to want to write "if cond == True:".

I don't see why you want to blame that inclination on PEP 285.  Folks are
perfectly capable of monstrosities like this without it:

	x = isinstance(foo, bar)
	if x == 1:
		...

If, as Fredrik says, there's already one obvious way to return True (and
that's the int 1), then we already have the problem that people will be
inclined to compare something to this canonical truth in conditional
statements.

I suppose you're saying that PEP 285 makes it worse?  I have no idea whether
you're right.  It certainly doesn't make ME more likely to do it.  ;-)

Cheers,

// mark






More information about the Python-list mailing list