[issue17559] str.is* implementation seem suboptimal for single character strings

2013-03-28 Thread Georg Brandl
Georg Brandl added the comment: Benjamin, if that comment means there's still something to be done, please reopen. -- nosy: +georg.brandl resolution: -> works for me status: open -> closed ___ Python tracker

[issue17559] str.is* implementation seem suboptimal for single character strings

2013-03-28 Thread Gaëtan de Menten
Gaëtan de Menten added the comment: Argl. I know I should have used 3.4... but that is what I thought I did. I used http://hg.python.org/cpython then "browse", and assumed it was the default branch... I know realize that since the last commit at that time was on the 2.7 branch, that is what I

[issue17559] str.is* implementation seem suboptimal for single character strings

2013-03-27 Thread Benjamin Peterson
Benjamin Peterson added the comment: There's still stuff in bytes_methods.c which looks like the old string code. -- ___ Python tracker ___ __

[issue17559] str.is* implementation seem suboptimal for single character strings

2013-03-27 Thread STINNER Victor
STINNER Victor added the comment: If you would like to improve Python, you have to focus on the development version which is Python 3.4. In this version, the code is different: if (length == 1) return PyBool_FromLong( Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, 0)));

[issue17559] str.is* implementation seem suboptimal for single character strings

2013-03-27 Thread Benjamin Peterson
Benjamin Peterson added the comment: The shortcut seems fairly pointless to me. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue17559] str.is* implementation seem suboptimal for single character strings

2013-03-27 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +benjamin.peterson, ezio.melotti, haypo, serhiy.storchaka versions: +Python 3.4 ___ Python tracker ___

[issue17559] str.is* implementation seem suboptimal for single character strings

2013-03-27 Thread Gaëtan de Menten
New submission from Gaëtan de Menten: In isspace, isalpha, isalnum and isdigit, I see code like: /* Shortcut for single character strings */ if (PyString_GET_SIZE(self) == 1 && isspace(*p)) return PyBool_FromLong(1); Is it intentional to not use: if (PyString_GET_SIZE(self) == 1))