[issue42511] string in string not working

STINNER Victor report at bugs.python.org
Mon Nov 30 05:53:55 EST 2020


STINNER Victor <vstinner at python.org> added the comment:

The two strings a different, that's why Python returns False.

a = U+0627 U+0646 U+062f U+064a U+0645 U+0634 U+06a9
b = U+0627 U+0646 U+062f U+06cc U+0645 U+0634 U+06a9

U+064a != U+06cc

>>> unicodedata.name('\u064a')
'ARABIC LETTER YEH'
>>> unicodedata.name('\u06cc')
'ARABIC LETTER FARSI YEH'

Python doesn't know arabic, it only compares code pointers: the number 0x064a is not equal to the number 0x06cc.

It's not a bug, but a deliberate choice.

----------
nosy: +vstinner
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42511>
_______________________________________


More information about the Python-bugs-list mailing list