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/030103.html below:

[Python-Dev] Printing and __unicode__

[Python-Dev] Printing and __unicode__ [Python-Dev] Printing and __unicode__Guido van Rossum guido@python.org
Tue, 12 Nov 2002 14:16:02 -0500
> > > B. A file indicates "unicode-awareness" somehow. For a Unicode-aware
> > >    file, it tries __unicode__, __str__, and __repr__, in order.
> > 
> > I like this.
> 
> Ok, then the question is: How can a file indicate its
> unicode-awareness? I propose that presence of an attribute "encoding"
> is taken as such an indication; this would cover all existing cases
> with no change to the file-like objects. 

+1

> In case the stream is "natively" Unicode (i.e. doesn't ever convert to
> byte strings), setting encoding to None should be allowed (this
> actually indicates that StringIO should have the encoding attribute).

+1

--Guido van Rossum (home page: http://www.python.org/~guido/)



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