On 24 Apr 2013 01:25, "M.-A. Lemburg" <m...@egenix.com> wrote: > > On 23.04.2013 17:15, Barry Warsaw wrote: > > On Apr 22, 2013, at 06:22 PM, Guido van Rossum wrote: > > > >>> You can ask the same question about all the other codecs. (And that > >>> question has indeed been asked in the past.) > >> > >> Except for rot13. :-) > > > > The fact that you can do this instead *is* a bit odd. ;) > > > > from codecs import getencoder > > encoder = getencoder('rot-13') > > r13 = encoder('hello world')[0] > > Just as reminder: we have the general purpose > encode()/decode() functions in the codecs module: > > import codecs > r13 = codecs.encode('hello world', 'rot-13') > > These interface directly to the codec interfaces, without > enforcing type restrictions. The codec defines the supported > input and output types.
If we already have those, why aren't they documented? If they exist, they should be the first thing in the codecs module docs and the porting guide should list them as the replacement for the method versions when using encodings that aren't directly related to the text model, or when the input buffer for decoding isn't a bytes or bytearray object. Regards, Nick. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Apr 23 2013) > >>> Python Projects, Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope/Plone.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > 2013-04-17: Released eGenix mx Base 3.2.6 ... http://egenix.com/go43 > > ::::: Try our mxODBC.Connect Python Database Interface for free ! :::::: > > eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 > D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg > Registered at Amtsgericht Duesseldorf: HRB 46611 > http://www.egenix.com/company/contact/ > _______________________________________________ > Python-Dev mailing list > Python-Dev@python.org > http://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: http://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com