A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-April/003029.html below:

[Python-Dev] string.ato? and Unicode

[Python-Dev] string.ato? and Unicode [Python-Dev] string.ato? and UnicodeMark Hammond mhammond@skippinet.com.au
Sun, 2 Apr 2000 09:53:50 +1000
Is this an over-sight, or by design?

>>> string.atoi(u"1")
...
TypeError: argument 1: expected string, unicode found

It appears easy to support Unicode - there is already an explicit
StringType check in these functions, and it simply delegates to
int(), which already _does_ work for Unicode

A patch would leave the following behaviour:
>>> string.atio(u"1")
1
>>> string.atio(u"1", 16)
...
TypeError: can't convert non-string with explicit base

IMO, this is better than what we have now.  I'll put together a
patch if one is wanted...

Mark.





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4