[Python-Dev] Unicode and numerics
M.-A. Lemburg
mal@lemburg.com
Mon, 03 Apr 2000 14:59:21 +0200
I've just posted a new patch set to the patches list which
contains better support for Unicode in the int(), long(),
float() and complex() builtins.
There are some new APIs now which can be used by extension
writer to convert from Unicode to integers, floats and longs.
These APIs are fully Unicode aware, meaning that you can
also pass them any Unicode characters with decimal mappings,
not only the standard ASCII '0'-'9' ones.
One thing I noticed, which needs some discussion:
There are two separate APIs which convert long string literals
to long objects: PyNumber_Long() and PyLong_FromString().
The first applies the same error checking as does the
PyInt_FromString() API, while the latter does not apply
this check...
Question is: shouldn't the check for truncated
data ("9.5" -> 9L) be moved into PyLong_FromString() ?
BTW, should I also post patches to string.py which use the
simplified versions for string.ato?() I posted a few days ago ?
--
Marc-Andre Lemburg
______________________________________________________________________
Business: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/