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/1999-November/001132.html below:

[Python-Dev] Internationalization Toolkit

[Python-Dev] Internationalization Toolkit [Python-Dev] Internationalization ToolkitGreg Stein gstein@lyra.org
Thu, 11 Nov 1999 02:50:56 -0800 (PST)
On Wed, 10 Nov 1999, M.-A. Lemburg wrote:
> Tim Peters wrote:
> > BTW, is ord(unicode_char) defined?  And as what?  And does ord have an
> > inverse in the Unicode world?  Both seem essential.
> 
> Good points.
> 
> How about 
> 
>   uniord(u[:1]) --> Unicode ordinal number (32-bit)
> 
>   unichr(i) --> Unicode object for character i (provided it is 32-bit);
>                 ValueError otherwise

Why new functions? Why not extend the definition of ord() and chr()?

In terms of backwards compatibility, the only issue could possibly be that
people relied on chr(x) to throw an error when x>=256. They certainly
couldn't pass a Unicode object to ord(), so that function can safely be
extended to accept a Unicode object and return a larger integer.

Cheers,
-g

--
Greg Stein, http://www.lyra.org/




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