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/2001-September/017520.html below:

[Python-Dev] why doesn't print pass unicode strings on to the file object?

[Python-Dev] why doesn't print pass unicode strings on to the file object? [Python-Dev] why doesn't print pass unicode strings on to the file object?Martin von Loewis loewis@informatik.hu-berlin.de
Tue, 18 Sep 2001 10:02:15 +0200 (MEST)
> > I wish codecs.lookup returned a record with named fields, instead of a
> > list, so I could write
> > 
> > sys.stdout = codecs.lookup("iso-8859-1").writer(sys.stdout)
> > 
> > (the other field names would be encode,decode, and reader).
> 
> Why don't you write a small helper function for the codecs.py
> module ?!

Because I'd like to avoid an inflation of functions. Instead, I'd
prefer codecs.lookup to return an object that has the needed fields,
but behaves like a tuple for backwards compatibility.

> Note that the tuple interface was chosen for sake of speed and
> better handling at C level (tuples can be cached and are easily
> parseable in C).

It may be that an inherited tuple class might achieve the same
effect. Can you identify the places where codecs.lookup is assumed to
return tuples?

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