This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lemburg
Recipients georg.brandl, lemburg, pitrou
Date 2008-06-12.21:41:30
SpamBayes Score 0.00011753028
Marked as misclassified No
Message-id <48519807.6020704@egenix.com>
In-reply-to <1213304293.5903.11.camel@fsol>
Content
On 2008-06-12 22:58, Antoine Pitrou wrote:
> Antoine Pitrou <pitrou@free.fr> added the comment:
> 
> Le jeudi 12 juin 2008 à 20:26 +0000, Marc-Andre Lemburg a écrit :
>> Doesn't chr(100000) raise an exception in UCS2 builds ?
> 
> No, it returns a 2-character string.

Interesting... I wonder how applications will deal with this. They'd
normally expect to get a length 1 string from chr() or unichr().

I think chr() should only behave in this way if given an option.
Otherwise, it will definitely introduce hard to find bugs in
ported applications (and probably even in newly written ones).

Something like chr(x, surrogates=True) to enable returning
2 code points instead of raising an exception.

>> Note that sys.maxunicode is not available in Python 2.1
>> which is why I chose try-except approach.
> 
> I understand, but is the py3k version of pybench still
> compatible with Python 2.1?

You're right: probably not. Would be great to have the test on the
Py2.x version as well - to see the difference in performance.

Thanks,
-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jun 12 2008)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2008-07-07: EuroPython 2008, Vilnius, Lithuania            24 days to go

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::

    eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
     D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
            Registered at Amtsgericht Duesseldorf: HRB 46611
History
Date User Action Args
2008-06-12 21:41:34lemburgsetspambayes_score: 0.00011753 -> 0.00011753028
recipients: + lemburg, georg.brandl, pitrou
2008-06-12 21:41:33lemburglinkissue3092 messages
2008-06-12 21:41:31lemburgcreate