[Python-Dev] [Python-checkins] cpython (3.2): Avoid codec spelling issues by just using the utf-8 default.

M.-A. Lemburg mal at egenix.com
Fri May 6 00:32:59 CEST 2011

Raymond Hettinger wrote:
> On May 5, 2011, at 11:41 AM, Benjamin Peterson wrote:
>> 2011/5/5 raymond.hettinger <python-checkins at python.org>:
>>> http://hg.python.org/cpython/rev/1a56775c6e54
>>> changeset:   69857:1a56775c6e54
>>> branch:      3.2
>>> parent:      69855:97a4855202b8
>>> user:        Raymond Hettinger <python at rcn.com>
>>> date:        Thu May 05 11:35:50 2011 -0700
>>> summary:
>>>  Avoid codec spelling issues by just using the utf-8 default.
>> Out of curiosity, what is the issue?
> IIRC, the performance depended on how your spelled-it.
> I believe that is why the spelling got changed in Py3.3.

Not really. It got changed because we have canonical names
for the codecs which the stdlib should use rather than
rely on aliases. Performance-wise it only makes a difference
if you use it in tight loops.

> Either way, the code is simpler by just using the default.

... as long as the casual reader knows what the default it :-)

I think it's better to make the choice explicit, if the code
relies on a particular non-ASCII encoding. If it doesn't,
than the default is fine.

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, May 06 2011)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
2011-06-20: EuroPython 2011, Florence, Italy               45 days to go

::: Try our new mxODBC.Connect Python Database Interface 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

More information about the Python-Dev mailing list