[issue13821] misleading return from isidentifier

2017-06-30 Thread R. David Murray
R. David Murray added the comment: See also issue 30772 about the deeper problem. -- ___ Python tracker ___

[issue13821] misleading return from isidentifier

2017-06-29 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: -haypo ___ Python tracker ___ ___

[issue13821] misleading return from isidentifier

2017-06-29 Thread R. David Murray
R. David Murray added the comment: IMO allow_non_nfkc=True that just returns False would be a bad idea, since as Benjamin points out it *is* a valid identifier, it's just not normalized (yet). Raising might work, that way you could tell the difference, but that would be a weird API for such

[issue13821] misleading return from isidentifier

2017-06-23 Thread Matthias Bussonnier
Matthias Bussonnier added the comment: I have been bitten by that as well. I think the doc should mention to verify that the given string is normalized, not that it **should** be normalized. Agreed that If isidentifier could also possibly grow a `allow_non_nfkc=True` default parameter that

[issue13821] misleading return from isidentifier

2015-11-16 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- nosy: +pitrou ___ Python tracker ___ ___

[issue13821] misleading return from isidentifier

2015-11-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> docs@python components: +Documentation nosy: +docs@python, haypo, serhiy.storchaka stage: -> needs patch type: -> behavior versions: +Python 3.4, Python 3.5, Python 3.6 ___ Python

[issue13821] misleading return from isidentifier

2012-01-18 Thread Jim Jewett
New submission from Jim Jewett jimjjew...@gmail.com: Python identifiers are in NFKC form; string method .isidentifier() returns true on strings that are not in that form. In some contexts, these non-canonical strings will be replaced with their NFKC equivalent, but in other contexts (such as

[issue13821] misleading return from isidentifier

2012-01-18 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: I don't see why that's invalid. str.isidentifier() returning True means Python will accept it as an identifier. -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org

[issue13821] misleading return from isidentifier

2012-01-18 Thread Jim Jewett
Jim Jewett jimjjew...@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

[issue13821] misleading return from isidentifier

2012-01-18 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2012/1/18 Jim Jewett rep...@bugs.python.org: Jim Jewett jimjjew...@gmail.com added the comment: My preference would be for non_NFKC.isidentifier() to return False It *is* an identifier, though. Python will happily accept it. It

[issue13821] misleading return from isidentifier

2012-01-18 Thread Jim Jewett
Jim Jewett jimjjew...@gmail.com added the comment: @Benjamin -- the catch is, if it isn't already in NFKC form, then python won't really accept it as an identifier. Sometimes it will silently canonicalize it for you so that it seems to work, but other times it won't. And program calling

[issue13821] misleading return from isidentifier

2012-01-18 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2012/1/18 Jim Jewett rep...@bugs.python.org: Jim Jewett jimjjew...@gmail.com added the comment: @Benjamin -- the catch is, if it isn't already in NFKC form, then python won't really accept it as an identifier.  Sometimes it will