A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-April/125425.html below:

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

[Python-Dev] Why can't I encode/decode base64 without importing a module? [Python-Dev] Why can't I encode/decode base64 without importing a module?Oleg Broytman phd at phdru.name
Mon Apr 22 16:25:50 CEST 2013
On Mon, Apr 22, 2013 at 09:50:14AM -0400, Devin Jeanpierre <jeanpierreda at gmail.com> wrote:
> unicode_escape doesn't make any sense anymore -- python code is text,
> not bytes, so why does 'abc'.encode('unicode_escape') return bytes?

   AFAIU the situation is simple: unicode.encode(encoding) returns
bytes, bytes.decode(encoding) returns unicode, and neither
unicode.decode() nor bytes.encode() exist.
   Transformations like base64 and bz2 are nor encoding/decoding -- they
are bytes/bytes or unicode/unicode transformations.

Oleg.
-- 
     Oleg Broytman            http://phdru.name/            phd at phdru.name
           Programmers don't die, they just GOSUB without RETURN.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4