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/040063.html below:

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

[Python-Dev] Optional arguments for str.encode /.decodeBarry Warsaw barry at python.org
Fri Nov 7 10:31:29 EST 2003
On Fri, 2003-11-07 at 10:24, Alex Martelli wrote:

> We must keep supporting that approach, yes (alas), but maybe it's
> not too late to encourage another alternative style instead?  E.g., have
> some object exposing attributes corresponding to those strings that
> do name codecs, so that while e.g.
> 
>     s.encode('zlib', level=9)
> 
> would have to keep working, the officially encouraged style would be:
> 
>     s.encode(codec.zlib, level=9)
> 
> or something of that ilk...?

If s.encode(codec.notacodec, level=9) throws an AttributeError, then
+1.  Add that to the original idea and +1 all around.

-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