[Python-Dev] Add transform() and untranform() methods (original) (raw)

Victor Stinner victor.stinner at gmail.com
Fri Nov 15 13:07:02 CET 2013


2013/11/15 Nick Coghlan <ncoghlan at gmail.com>:

The reason I'm now putting some effort into better documenting the status quo for codec handling in Python 3 and filing off some of the rough edges (rather than proposing adding any new APIs to Python 3.x) is because the users I care about in this matter are web developers that already make use of the binary codecs and are adopting the single-source approach to handle supporting both Python 2 and Python 3. Armin Ronacher is the one who's been most vocal about the problem, but he's definitely not alone.

Except of Armin Ronacher, I never see anyway blocked when trying to port a project to Python3 because of these bytes=>bytes and str=>str codecs. I did a quick search on Google but I failed to find a question "how can I write .encode("hex") or .encode("zlib") in Python 3?". It was just a quick search, it's likely that many developers hit this Python 3 regression, but I'm confident that developers are able to workaround themself this regression (ex: use directly the right Python module).

I saw a lot of huge code base ported to Python 3 without the need of these codecs. For example: Django which is a web framework has been ported on Python 3, I know that Armin Ronacher also works on web things (I don't know what exactly).

A new API for binary transforms is potentially an academically interesting concept, but it solves zero current real world problems.

I would like to reply the same for these codecs: they are not solving any real world problem :-)

Victor



More information about the Python-Dev mailing list