A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2010-December/106376.html below:

[Python-Dev] transform() and untransform() methods, and the codec registry

[Python-Dev] transform() and untransform() methods, and the codec registryAlexander Belopolsky alexander.belopolsky at gmail.com
Fri Dec 3 19:28:08 CET 2010
On Fri, Dec 3, 2010 at 4:16 AM, Victor Stinner
<victor.stinner at haypocalc.com> wrote:
..
> I don't like transform() and untransform() because I think that we should not
> add too much operations to the base types (bytes and str), and they do
> implicit module import. I prefer explicit module import (eg. import binascii;
> binascii.hexlify(b'to hex')).

+1

Implicit imports are currently subtly broken with no solution in sight.  See

http://bugs.python.org/issue8098
http://bugs.python.org/issue7980

In fact, once the language moratorium is over, I will argue that
str.encode() and byte.decode() should deprecate encoding argument and
just do UTF-8 encoding/decoding.  Hopefully by that time most people
will forget that other encodings exist.  (I can dream, right?)  Python
can still provide the codec machinery but not tie it to str/bytes
builtins.  After all, neither encode/decode nor transform/unstransform
fully utilize the power of codec design.
More information about the Python-Dev mailing list

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