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

Raymond Hettinger python at rcn.com
Fri Nov 7 10:36:19 EST 2003

> > Actually what I was complaining about probably is too late to "fix".

> We must keep supporting that approach, yes (alas), but maybe it's
> not too late to encourage another alternative style instead?  E.g.,
> 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...?

+1, that is a great idea.


More information about the Python-Dev mailing list