[Python-Dev] Why can't I encode/decode base64 without importing a module?

Lennart Regebro regebro at gmail.com
Tue Apr 23 06:48:04 CEST 2013


On Tue, Apr 23, 2013 at 4:04 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> As others have pointed out in the past, repeatedly, the codec system is
> completely general and can transform bytes->bytes and text->text just as
> easily as bytes<->text.

Yes, but the encode()/decode() methods are not, and the fact that you
now know what goes in and what comes out means that people get much
fewer Decode/EncodeErrors. Which is a good thing.

//Lennart


More information about the Python-Dev mailing list