[Python-ideas] Add "namereplace" error handler

Victor Stinner victor.stinner at gmail.com
Tue Jun 11 14:01:46 CEST 2013


2013/6/11 Serhiy Storchaka <storchaka at gmail.com>:
> I propose to add "namereplace" error handler which is similar to
> "backslashreplace" error handler but use \N escapes instead of \x/\u/\U
> escapes.
> ...
> What are you think about this? Are there suggestions for better name?

I like your idea (+1). For the name, I propose "unicodename":

str.encode('ascii', 'unicodename")

But I like "namereplace". What is the complexity of
unicodedata.lookup(char)? O(1)?


More information about the Python-ideas mailing list