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

Guido van Rossum guido@python.org
Fri, 08 Mar 2002 14:44:38 -0500


>>> True * 10 10 >>> False * 10 0

If you want to dive into logic here, the only correct output would be: >>> True * 10 True >>> False * 10 False

What has logic got to do with this?

However, this would break even more code... your bool type is much more like a bit type (or would have to behave like one in order to maintain backwards compatibility).

I never said otherwise. It behaves exactly like int except for those operations where the PEP specifies something different. This is intentional, since anything else will break too much code.

--Guido van Rossum (home page: http://www.python.org/~guido/)