[New-bugs-announce] [issue32285] In `unicodedata`, it should be possible to check a unistr's normal form without necessarily copying it

Maxime Belanger report at bugs.python.org
Mon Dec 11 20:16:10 EST 2017


New submission from Maxime Belanger <max at 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 <report at bugs.python.org>
<https://bugs.python.org/issue32285>
_______________________________________


More information about the New-bugs-announce mailing list