]> granicus.if.org Git - python/commit
Add the 'bool' type and its values 'False' and 'True', as described in
authorGuido van Rossum <guido@python.org>
Wed, 3 Apr 2002 22:41:51 +0000 (22:41 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 3 Apr 2002 22:41:51 +0000 (22:41 +0000)
commit77f6a65eb00f005939c6c7c5d6ac0f037a0ce1bd
treee92163095e7ae548c36cea459dad87db74a413ef
parente9c0358bf45bd6e0fe0b17720b41d20d618e6d9d
Add the 'bool' type and its values 'False' and 'True', as described in
PEP 285.  Everything described in the PEP is here, and there is even
some documentation.  I had to fix 12 unit tests; all but one of these
were printing Boolean outcomes that changed from 0/1 to False/True.
(The exception is test_unicode.py, which did a type(x) == type(y)
style comparison.  I could've fixed that with a single line using
issubtype(x, type(y)), but instead chose to be explicit about those
places where a bool is expected.

Still to do: perhaps more documentation; change standard library
modules to return False/True from predicates.
29 files changed:
Doc/lib/libfuncs.tex
Doc/lib/libstdtypes.tex
Doc/ref/ref3.tex
Include/Python.h
Include/intobject.h
Include/object.h
Lib/difflib.py
Lib/doctest.py
Lib/pickle.py
Lib/test/output/test_augassign
Lib/test/output/test_extcall
Lib/test/output/test_gettext
Lib/test/output/test_grammar
Lib/test/output/test_richcmp
Lib/test/test_descr.py
Lib/test/test_descrtut.py
Lib/test/test_generators.py
Lib/test/test_unicode.py
Makefile.pre.in
Modules/cPickle.c
Modules/operator.c
Objects/dictobject.c
Objects/fileobject.c
Objects/intobject.c
Objects/object.c
Objects/stringobject.c
Objects/unicodeobject.c
Python/bltinmodule.c
Python/marshal.c