This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: PEP 285 - Adding a bool type
Type: Stage:
Components: Interpreter Core Versions: Python 2.3
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: gvanrossum, loewis
Priority: normal Keywords: patch

Created on 2002-03-10 05:45 by gvanrossum, last changed 2022-04-10 16:05 by admin. This issue is now closed.

File name Uploaded Description Edit
booldiff.txt gvanrossum, 2002-03-10 05:45 Diffs for bool type (1st upload)
booldiff2.txt gvanrossum, 2002-04-01 02:46 New version (March 31)
booldiff3.txt gvanrossum, 2002-04-03 23:04 Corrected new version (April 2nd). Last one.
Messages (5)
msg39212 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-03-10 05:45
Here's a preliminary implementation of the PEP,
including unittests  checking the promises made in the
PEP ( and (some) documentation.

With this 12 tests fail for me (on Linux); I'll look
into these later.  They appear shallow (mostly doctests
dying on True or False where 1 or 0 was expected).

Note: the presence of this patch does not mean that the
PEP is accepted -- it just means that a sample
implementation exists in case someone wants to explore
the effects of the PEP on their code.
msg39213 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-04-01 02:46
Logged In: YES 

Here's an updated diff (booldiff2.txt). It fixes a refcount
bug in bool_repr(), and works with current CVS.

With this patch set, 10 standard tests fail for shallow
reasons having to do with str() or repr() returning False or
True instead of 0 or 1. Here are the failed tests:

    test_descr test_descrtut test_difflib test_doctest
    test_generators test_gettext test_richcmp
msg39214 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-04-01 11:44
Logged In: YES 

This patch does not support pickling of bools (the PEP
should probably spell out how they are pickled). marshalling
of bools does not round-trip (you get back an int).
msg39215 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-04-03 20:43
Logged In: YES 

I've attached a new patch, booldiff3.txt, that solves the
two remaining problems:

- picke, cPickle and marshal roundtrip

- the test suite succeeds (a total of 12 tests had to be
fixed, all because of True/False vs. 1/0 in printed output)

I'm ready to check this in, but I'll first update the PEP.
msg39216 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-04-03 23:04
Logged In: YES 

Here's a new version of booldiff.txt that includes the new
files boolobject.[ch] and  Sorry.
Date User Action Args
2022-04-10 16:05:05adminsetgithub: 36234
2002-03-10 05:45:44gvanrossumcreate