Message144703
| Author |
ezio.melotti |
| Recipients |
ezio.melotti, gvanrossum, lemburg, loewis, mrabarnett, tchrist, terry.reedy |
| Date |
2011年09月30日.20:30:42 |
| SpamBayes Score |
3.286651e-06 |
| Marked as misclassified |
No |
| Message-id |
<1317414642.85.0.0881821462071.issue12753@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Leaving named sequences for unicodedata.lookup() only (and not for \N{}) makes sense.
The list of aliases is so small (11 entries) that I'm not sure using a binary search for it would bring any advantage. Having a single lookup algorithm that looks in both tables doesn't work because the aliases lookup must be in _getcode for \N{...} to work, whereas the lookup of named sequences will happen in unicodedata_lookup (Modules/unicodedata.c:1187).
I think we can leave the for loop over aliases in _getcode and implement a separate (and binary) search in unicodedata_lookup for the named sequences. Does that sound fine? |
|