Message 308085 - Python tracker (original) (raw)

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!