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

Stephen J. Turnbull stephen at xemacs.org
Thu Apr 25 08:57:32 CEST 2013


Lennart Regebro writes:

 > Base64 is an encoding that transforms between 8-bit streams. Let it be
 > that. Don't try to shoehorn it into a completely different kind of
 > encoding.

By "completely different kind of encoding" do you mean "codec"?

I think that would be an unfortunate result.  These operations on
streams are theoretically nicely composable.  It would be nice if
practice reflected that by having a uniform API for all of these
operations (charset translation, encoded text to internal, content
transfer encoding, compression ...).  I think it would be useful, too,
though I can't prove that.

Anyway, this discussion belongs on python-ideas at this point.  Or
would, if I had an idea about implementation.  I'll take it there when
I do have something to say about implementation.


More information about the Python-Dev mailing list