[Python-3000] PEP 3108: Standard Library Reorganization

Brett Cannon brett at python.org
Wed Jan 3 09:00:08 CET 2007


On 1/2/07, Barry Warsaw <barry at python.org> wrote:
>
> -----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").



It sounds like codecs needs a little lovin'.  The thing has been around
since Python 2.0 which is before my time on python-dev so I don't know
anything about its design.  But I would assume it is going to get used a lot
more come Py3K for Unicode conversion.  Maybe some of your and Anthony's
issues can be addressed so that at least some point in the future we can
transition people over to a common setup for encodings and off of base64 and
such (but it won't be Python 3.0).

-Brett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-3000/attachments/20070103/3cf605b7/attachment.html 


More information about the Python-3000 mailing list