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/2003-November/040057.html below:

[Python-Dev] Optional arguments for str.encode /.decode

[Python-Dev] Optional arguments for str.encode /.decode [Python-Dev] Optional arguments for str.encode /.decodeBarry Warsaw barry at python.org
Fri Nov 7 09:22:32 EST 2003
On Fri, 2003-11-07 at 02:33, Raymond Hettinger wrote:
> Idea for the day:  Let the str.encode/decode methods accept keyword
> arguments to be forwarded to the underlying codec.

Nice.

> Already, the existing protocol has provided consistent, uniform access
> to a variety of services:
> 
>     text.encode('quotedprintable')
>     text.encode('rot13')
>     text.encode('palmos')
> 
> The proposed extension allows this benefit to apply to an even broader
> range of services.

Which is all really cool.  The only thing that begins to bother me about
this is the use of strings as name lookup keys for finding functions. 
This seems generally unpythonic and error prone -- aside from the
documentation problem that the list of standard lookup keys is buried in
a non-obvious place.

-Barry



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