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/2002-November/030127.html below:

[Python-Dev] Printing and __unicode__

[Python-Dev] Printing and __unicode__ [Python-Dev] Printing and __unicode__Martin v. Loewis martin@v.loewis.de
13 Nov 2002 21:23:36 +0100
Guido van Rossum <guido@python.org> writes:

> Though it acts somewhat as if its default encoding is "ascii".  This
> is somewhat inconsistent: you can write arbitrary Unicode strings, but
> the Unicode won't be converted to ASCII.  ASCII is converted to
> Unicode though.

It is the only case of a "pure Unicode" stream in Python, where the
underlying "native" sequence is not one of bytes, but one of Unicode
characters.

The real problem is that the "orientation" (wide or narrow strings) is
determined by the things written into the stream.

It might be more reasonable to have StringIO.ByteIO and
StringIO.UnicodeIO constructors, which both accept an encoding=
argument, and will convert objects of the wrong "orientation"
using that encoding (defaulting to the system encoding).

Regards,
Martin




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