homepage

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.

classification
Title: PEP 285 - Adding a bool type
Type: Stage:
Components: Interpreter Core Versions: Python 2.3
process
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.

Files
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 (test_bool.py) 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 
user_id=6380
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_extcall
 test_generators test_gettext test_richcmp
test_richcompare
 test_unicode
msg39214 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002年04月01日 11:44
Logged In: YES 
user_id=21627
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 
user_id=6380
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 
user_id=6380
Here's a new version of booldiff.txt that includes the new
files boolobject.[ch] and test_bool.py. Sorry.
History
Date User Action Args
2022年04月10日 16:05:05adminsetgithub: 36234
2002年03月10日 05:45:44gvanrossumcreate

AltStyle によって変換されたページ (->オリジナル) /