Message203579
The proposed patch adds the "namereplace" error handler. This error handler is almost same as the "backslashreplace" error handler, but use \N{...} escape sequences if there is a character name in Unicode database. Result is a little more human-readable (but less portable) than with "backslashreplace".
>>> '∀ x∈ℜ'.encode('ascii', 'namereplace')
b'\\N{FOR ALL} x\\N{ELEMENT OF}\\N{BLACK-LETTER CAPITAL R}'
The proposition was discussed and bikeshedded on Python-Ideas: http://comments.gmane.org/gmane.comp.python.ideas/21296 . |
|
Date |
User |
Action |
Args |
2013-11-21 07:41:47 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, vstinner, ezio.melotti |
2013-11-21 07:41:46 | serhiy.storchaka | set | messageid: <1385019706.69.0.579937406555.issue19676@psf.upfronthosting.co.za> |
2013-11-21 07:41:46 | serhiy.storchaka | link | issue19676 messages |
2013-11-21 07:41:46 | serhiy.storchaka | create | |
|