Message187701
Just copying some details here about codecs.encode() and
codec.decode() from python-dev:
"""
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.
"""
As Nick found, these aren't documented, which is a documentation
bug (I probably forgot to add documentation back then).
They have been in Python since 2004:
http://hg.python.org/cpython-fullhistory/rev/8ea2cb1ec598
These API are nice for general purpose codec work and
that's why I added them back in 2004.
For the codecs in question, it would still be nice to have
a more direct way to access them via methods on the types
that you typically use them with. |
|
Date |
User |
Action |
Args |
2013-04-24 13:47:10 | lemburg | set | recipients:
+ lemburg, gvanrossum, loewis, barry, georg.brandl, gregory.p.smith, jcea, cben, ncoghlan, belopolsky, vstinner, benjamin.peterson, ezio.melotti, eric.araujo, r.david.murray, ssbarnea, flox, petri.lehtinen, pconnell |
2013-04-24 13:47:10 | lemburg | link | issue7475 messages |
2013-04-24 13:47:10 | lemburg | create | |
|