dive into mark

You are here: dive into markArchivesApril 2002Python grows a boolean

Tuesday, April 9, 2002

Python grows a boolean

Guido van Rossum: ACCEPTED: PEP 285.

This PEP proposes the introduction of a new built-in type, bool, with two constants, False and True. The bool type would be a straightforward subtype (in C) of the int type, and the values False and True would behave like 0 and 1 in most respects (for example, False==0 and True==1 would be true) except repr() and str(). All built-in operations that conceptually return a Boolean result will be changed to return False or True instead of 0 or 1; for example, comparisons, the “not” operator, and predicates like isinstance().

The boolean type will appear in Python 2.3, which is tentatively scheduled to be released this fall. I haven’t touched Dive Into Python in months, but I’ll probably touch it before this fall, and I’ll have to include a historical note about this.

Filed under

Respond privately

I am no longer accepting public comments on this post, but you can use this form to contact me privately. (Your message will not be published.)



Recent Stuff For You, Special Price Stay Here
  • Greasemonkey Hacks
Good Stuff Buy The Cow Go Away
Dive Into Python
Powered by Google Drink The Milk Don't Steal

 

posts / comments
© 2001-8 Mark Pilgrim