[Python-Dev] bool conversion wart?

"Martin v. Löwis" martin at v.loewis.de
Fri Feb 23 22:27:12 CET 2007


Greg Ewing schrieb:
> But bool isn't really a numeric type in the same way
> that the others are. It's only a subtype of int for
> historical reasons. If it had been a part of Python
> from the beginning, it probably would have been a
> separate type altogether.
> 
> Hmmm... is that something that should be revisited
> in 3.0?

I specifically asked the question when unifying ints
and longs for 3.0 (as int went away, the question was
what True and False ought to be). Guido pronounced
that it is deliberate that they are "integer-like",
and should continue to inherit from the integer type.

One idiom that people use a lot is foo[b], where
b is a boolean.

Regards,
Martin


More information about the Python-Dev mailing list