Author lemburg
Recipients docs@python, lemburg
Date 2010-12-02.22:31:13
SpamBayes Score 1.45108e-09
Marked as misclassified No
Message-id <1291329082.54.0.0152970985117.issue10610@psf.upfronthosting.co.za>
In-reply-to
Content
The Python3 documentation for these numeric constructors is wrong.

Python has supported Unicode numerals specified as code points from the Unicode category "Nd" (decimal digit) since Python 1.6.0 when Unicode was first introduced in Python.

    http://www.unicode.org/versions/Unicode5.2.0/ch04.pdf
    (see Section 4.5: General Category)

The Python3 documentation adds a reference to the language spec which is not really ideal, since the language spec has different requirements than a number object constructor which has to deal with data input rather than program text:

    http://docs.python.org/dev/py3k/library/functions.html#float

The Python2 documentation does not have such an implication:

    http://docs.python.org/library/functions.html#float

The Python3 documentation needs to be extended to either mention that all Unicode code points from the Unicode category "Nd"  (decimal digit) are accepted as digits and used with their corresponding decimal digit value, or include a copy of the referenced language spec section with this definition of ''digit'':

digit := ::=  "0"..."9" and any Unicode code point with property "Nd"

Here's a complete list of the code point ranges that have this property:

   http://www.unicode.org/Public/5.2.0/ucd/extracted/DerivedNumericType.txt

(scroll to the end of the file)

It would also be worthwhile to add a note to the Python2 documentation.
History
Date User Action Args
2010-12-02 22:31:22lemburgsetrecipients: + lemburg, docs@python
2010-12-02 22:31:22lemburgsetmessageid: <1291329082.54.0.0152970985117.issue10610@psf.upfronthosting.co.za>
2010-12-02 22:31:13lemburglinkissue10610 messages
2010-12-02 22:31:13lemburgcreate