April 23, 2013
4:47 p.m.
On Tue, Apr 23, 2013 at 8:22 AM, M.-A. Lemburg <mal@egenix.com> wrote:
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 an implementation mechanism I see nothing wrong with this. I hope the codecs module lets you introspect the input and output types of a codec given by name? -- --Guido van Rossum (python.org/~guido)