> > 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