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

Barry Warsaw barry at python.org
Fri Nov 7 12:19:12 EST 2003


On Fri, 2003-11-07 at 11:11, Tim Hochberg wrote:

> The downside is that::
> 
>      s.encode(codec.zlib)
> 
> wouldn't work. One would probably have to use the more verbose syntax::
> 
>      s.encode(codec.zlib())

Maybe not.  s.encode() can magically zero-arg instantiate the class. 
We're starting to put a lot of smarts into .encode() and .decode() but I
think it's worth it.  Nice idea.

-Barry





More information about the Python-Dev mailing list