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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com