[Python-3000] PEP 3108: Standard Library Reorganization

Barry Warsaw barry at python.org
Wed Jan 3 03:51:17 CET 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Jan 2, 2007, at 7:52 PM, Brett Cannon wrote:

>> base64 and quopri implement specific RFCs so I think they should
>> stay.  uu implements a defacto standard, but I don't like its
>> interface (it uses file-like objects instead of strings).  For Py3K,
>> I would be in favor of consolidating things, making interfaces
>> consistent, and probably re-homing the modules under a top-level
>> package.
>
> But isn't that what the codecs module is for?  If cleaning up the  
> API is
> going to happen shouldn't be to add whatever encoders/decoders that  
> codecs
> is missing to replace these modules?

IMO, no.  The "problem" with the codecs is that it doesn't seem like  
a natural interface for doing these kinds of conversions.  One  
problem is documentation: if I want to base64 encode some bytes with  
an alternate alphabet and the only hammer I've got is the codecs  
module, how do I find out about this hammer and where do I go for  
(specifically the base64 semantics) documentation?  Or let's say I  
want to base32 encode some byte but I want to fold the case and map 0  
and 1 to an alternative alphabet.  How do I pass that into the  
codec?  Finally, the codecs tend to take strings as arguments so if I  
misspell "base63" I'm going to get a lookup error which is much more  
confusing than the name or attribute error ("hmm, maybe my distro  
didn't package up all the codecs").

- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iQCVAwUBRZsaN3EjvBPtnXfVAQKhBwP9FwraAd5XueoD7pTTAiZsLpSp8HjPAXI6
NGFrI4IE7gTVvBK1+TlAh/MySJl3oUFro1/m5q93r8yzrCm1KODavj0QDdYm+loV
/gsVOTTD4D46YBQf06MeUaTk1Xe7eUTGPp4UMPf/iMMjnSnXYx4CYN3PJ8cZPSKp
d6X3T0N7dPs=
=NB2+
-----END PGP SIGNATURE-----


More information about the Python-3000 mailing list