[docs] [issue10610] Correct the float(), int() and complex() documentation

Marc-Andre Lemburg report at bugs.python.org
Thu Dec 2 23:31:22 CET 2010


New submission from Marc-Andre Lemburg <mal at egenix.com>:

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.

----------
assignee: docs at python
components: Documentation, Unicode
messages: 123136
nosy: docs at python, lemburg
priority: normal
severity: normal
status: open
title: Correct the float(), int() and complex() documentation
versions: Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10610>
_______________________________________


More information about the docs mailing list