> They are convenience methods to the codecs registry > with the added benefit of applying type checks which the codecs > registry does not guarantee since it only manages codecs.
I argue that things that could be parameters to .transform don't belong into the codec registry in the first place. > Of course, you can write everything directly against the codec > registry or some other specialized interface, but that's not > really what we're after here. No need for writing directly against the codec registry. Using some other specialized interface: yes, Yes, YES! > Motivation: When was the last time you used a gzip compression > option (ie. yes there are options, but do you use them in the > general use case) ? Depends on what I do: when I invoke gzip from the command line, I pass -9 all the time, as a habit. Or did you mean "in Python"? It's a long time that I needed to use the gzip module at all; and the last few times, I suppose it was always through the tarfile module. I use gzip so rarely that I find it wasteful that it gets its own shortcut. If I had a (half-serious) wish for a string method shortcut, it would be "GET / HTTP/1.0\r\n\r\n".sendto("foo.bar.com", 80) Perhaps I should write a codec for that: "GET / HTTP/1.0\r\n\r\n".encode("http:foo.bar.com") which sends the request and returns the response :-) > Can you write code that applies UU encoding > without looking up the details in the documentation (ie. there > is a module for doing UU-encoding in the stdlib, but what's it's > name, what's the function, does it need extra logic) ? You mean, without looking into the HTML documentation? Sure enough. "import uu" I remember, then I do help(uu), scroll to the end. If you can't remember that the module's name is uu, then you probably can't remember the codec, either: py> "foo".encode("uuencode") Traceback (most recent call last): File "<stdin>", line 1, in <module> LookupError: unknown encoding: uuencode Regards, Martin _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com