<br><br><div><span class="gmail_quote">On 1/2/07, <b class="gmail_sendername">Barry Warsaw</b> <<a href="mailto:barry@python.org">barry@python.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
-----BEGIN PGP SIGNED MESSAGE-----<br>Hash: SHA1<br><br>On Jan 2, 2007, at 7:52 PM, Brett Cannon wrote:<br><br>>> base64 and quopri implement specific RFCs so I think they should<br>>> stay. uu implements a defacto standard, but I don't like its
<br>>> interface (it uses file-like objects instead of strings). For Py3K,<br>>> I would be in favor of consolidating things, making interfaces<br>>> consistent, and probably re-homing the modules under a top-level
<br>>> package.<br>><br>> But isn't that what the codecs module is for? If cleaning up the<br>> API is<br>> going to happen shouldn't be to add whatever encoders/decoders that<br>> codecs<br>
> is missing to replace these modules?<br><br>IMO, no. The "problem" with the codecs is that it doesn't seem like<br>a natural interface for doing these kinds of conversions. One<br>problem is documentation: if I want to base64 encode some bytes with
<br>an alternate alphabet and the only hammer I've got is the codecs<br>module, how do I find out about this hammer and where do I go for<br>(specifically the base64 semantics) documentation? Or let's say I<br>want to base32 encode some byte but I want to fold the case and map 0
<br>and 1 to an alternative alphabet. How do I pass that into the<br>codec? Finally, the codecs tend to take strings as arguments so if I<br>misspell "base63" I'm going to get a lookup error which is much more
<br>confusing than the name or attribute error ("hmm, maybe my distro<br>didn't package up all the codecs").</blockquote><div><br><br>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).<br><br>-Brett<br></div></div>