[issue23550] Add to unicodedata a function to query the "Quick_Check" property for a character

Hammerite report at bugs.python.org
Tue Mar 24 22:42:22 CET 2015


Hammerite added the comment:

I tried to add these responses within the code review section of the site, but I am unable to do so; when I click "Send Message", I am taken to a page that consists of the text "500 Server Error" and no other content. Therefore I am responding to the code review comments here.

Ezio:

The form comes before the chr because that is the order unicodedata.normalize() takes its arguments (though it takes a string rather than a single character). To write normalize(form, str) but quick_check(chr, form) would be quite inconsistent, I think, and would invite confusion. Agreed that a brief description of what the property is useful for would be good; I will make another patch that includes this.

I will delete the space after the function name. I will also eliminate the column arrangement of the test code, although I think that this will make the code much less readable.

Berker:

Regarding whatsnew: Since I have your invitation to do so, I will. Regarding putting the normalisation form comparison into helper functions, I will follow your suggestion, and incorporate the improvement for normalize() as well.

For the error message, this is the same error message that is given by unicodedata.normalize(). I could change it, but if I do, I think I should change it for normalize() at the same time.

For two of your other points I would like to observe that the way I have done things is in mimicry of existing code that relates to the unicodedata module. Elsewhere in unicodedata.c multiline strings are continued using \, so I have done the same; in makeunicodedata.py the other arrays are not static so the new one is not static either. I could make these changes regardless, but the result would be inconsistency in the code. Or I could change these things everywhere in the relevant files, but this would mean I would be changing parts of the files that are not properly related to this issue.

For the remaining stylistic points, I will make the changes you asked for.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23550>
_______________________________________


More information about the Python-bugs-list mailing list