New submission from Maxime Belanger <m...@dropbox.com>:

In our deployment of Python 2.7, we've patched `unicodedata` to introduce a new 
function: `is_normalized` can check whether a unistr is in a given normal form. 
This currently has to be done by creating a normalized copy, then checking 
whether it is equal to the source string.

This function uses the internal helper (also called `is_normalized`) that can 
"quick check" normalization, but falls back on creating a normalized copy and 
comparing (when necessary).

We're contributing this change in case this can helpful to others. Feedback is 
welcome!

----------
components: Unicode
messages: 308085
nosy: Maxime Belanger, ezio.melotti, vstinner
priority: normal
severity: normal
status: open
title: In `unicodedata`, it should be possible to check a unistr's normal form 
without necessarily copying it
versions: Python 2.7, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32285>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to