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

2018-11-04 Thread Benjamin Peterson
Benjamin Peterson added the comment: New changeset 2810dd7be9876236f74ac80716d113572c9098dd by Benjamin Peterson (Max Bélanger) in branch 'master': closes bpo-32285: Add unicodedata.is_normalized. (GH-4806) https://github.com/python/cpython/commit/2810dd7be9876236f74ac80716d113572c9098dd

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

2018-10-24 Thread Maxime Belanger
Change by Maxime Belanger : -- versions: +Python 3.8 -Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list

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

2017-12-12 Thread STINNER Victor
STINNER Victor added the comment: > However, I'm concerned by your comment that you fall back on creating a > normalized copy and comparing. The purpose of the function is to be faster than str == unicodedata.normalize(form, str). So yeah, any optimization is

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

2017-12-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: Python 2.7 is in feature freeze, so this can only go into 3.7. I would find this useful, and would like this feature. However, I'm concerned by your comment that you fall back on creating a normalized copy and comparing. That

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

2017-12-11 Thread Max Bélanger
Change by Max Bélanger : -- keywords: +patch pull_requests: +4703 stage: -> patch review ___ Python tracker ___

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

2017-12-11 Thread Maxime Belanger
New submission from Maxime Belanger : 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