Tal Einat added the comment:

> What's the reason for checking if the ord is >= 128?

It's an optimization. Assuming the majority of characters will be ASCII, most 
non-identifier characters will fail this test, thus avoiding the more involved 
generic Unicode check.

> However, I would propose that methods .isidstart and
> .isidcontinue get added to the str type if there is a
> need for them.

I was surprised to find .isidentifier() is a method of the str type. Even if 
that is considered useful enough to be a method of str, I don't think the 
functions you suggest are generally useful enough to warrant being added as 
methods.

Then again, I'm no authority on decided what gets included as methods of base 
types. Regardless, I'd rather this patch go in without affecting str; adding 
these methods to str is a separate issue. If someone decides to pursue that, 
feel free to use this code and/or +nosy me.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21765>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to