M.-A. Lemburg wrote: > [...] >>Or we could have a function that recreates the dictionary from the string. > > Actually, I'd prefer that these operations be done by the > codec generator script, so that we don't have additional > startup time. The dictionaries should then no longer be > generated and instead. I'd like the comments to stay, though. > This can be done like this (using string concatenation > applied by the compiler): > > decoding_charmap = ( > u'x' # 0x0000 -> 0x0078 LATIN SMALL LETTER X > u'y' # 0x0001 -> 0x0079 LATIN SMALL LETTER Y > ... > ) I'd prefer that too. > Either way, monkey patching the codec won't work anymore. > Doesn't really matter, though, as this was never officially > supported. > > We've always told people to write their own codecs > if they need to modify an existing one and then hook it into > the system using either a new codec search function or by > adding an appropriate alias. OK, so can someone update gencodec.py and recreate the charmap codecs? BTW, is codecs.make_encoding_map part of the official API, or can we change it to expect a string instead of a dictionary? Bye, Walter Dörwald
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