[issue13821] misleading return from isidentifier

Jim Jewett report at bugs.python.org
Thu Jan 19 02:05:13 CET 2012


Jim Jewett <jimjjewett at gmail.com> added the comment:

My preference would be for non_NFKC.isidentifier() to return False, but that may be a problem for backwards compatibility.

It *may* be worth adding an asidentifier() method that returns either False or the canonicalized string that should be used instead.

At a minimum, the documentation (including docstring) should warn that the method doesn't check for NFKC form, and that if the input is not ASCII, the caller should first ensure this by calling str1=unicodedata.normalize("NFKC", str1)

----------

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


More information about the Python-bugs-list mailing list