[Python-ideas] Add "namereplace" error handler

M.-A. Lemburg mal at egenix.com
Tue Jun 11 14:34:48 CEST 2013


On 11.06.2013 13:21, Serhiy Storchaka wrote:
> I propose to add "namereplace" error handler which is similar to "backslashreplace" error handler
> but use \N escapes instead of \x/\u/\U escapes.
> 
>>>> '−1'.encode('ascii', 'backslashreplace')
> b'\\u22121'
>>>> '−1'.encode('ascii', 'namereplace')
> b'\\N{MINUS SIGN}1'
> 
> In some cases such representation is more readable.
> 
> What are you think about this? Are there suggestions for better name?

Nice idea.

I think 'namereplace' is fine. An alternative would be
'unicodenamereplace'.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jun 11 2013)
>>> Python Projects, Consulting and Support ...   http://www.egenix.com/
>>> mxODBC.Zope/Plone.Database.Adapter ...       http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2013-07-01: EuroPython 2013, Florence, Italy ...           20 days to go
2013-07-16: Python Meeting Duesseldorf ...                 35 days to go

::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/


More information about the Python-ideas mailing list