[issue22530] re rejects index of type long on 2.7

2014-10-02 Thread Gregory P. Smith
Gregory P. Smith added the comment: thanks. btw an alternative type check to consider in these situations: PyIndex_Check https://docs.python.org/2/c-api/number.html#c.PyIndex_Check but what you wrote works. -- nosy: +gregory.p.smith ___ Python

[issue22530] re rejects index of type long on 2.7

2014-09-30 Thread Ryan Gonzalez
New submission from Ryan Gonzalez: This should work (but doesn't): Python 2.7.8+ (2.7:63dc1e32b715, Sep 30 2014, 19:24:46) [GCC 4.2.1 Compatible Clang 3.5.0 (207381)] on linux2 Type help, copyright, credits or license for more information. import re re.match('(foo)', 'foo').group(1L)

[issue22530] re rejects index of type long on 2.7

2014-09-30 Thread Steven D'Aprano
Steven D'Aprano added the comment: As I explained on the thread (possibly my post crossed in the mail with Ryan's patch) I don't believe this is a bug fix. MatchObject.group has only accepted actual ints, not longs, since Python 1.5 (tested 1.5, 2.4-2.7). Nor is there any requirement to

[issue22530] re rejects index of type long on 2.7

2014-09-30 Thread Guido van Rossum
Guido van Rossum added the comment: I haven't seen the fix, but any place where an int is accepted but a long is not, is a bug. The language has been on a long trip to making the two types interchangeable and this seems one of the last remnants. -- nosy: +gvanrossum

[issue22530] re rejects index of type long on 2.7

2014-09-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 30f72ed73c3b by Benjamin Peterson in branch '2.7': allow longs as indexes to group() (closes #22530) https://hg.python.org/cpython/rev/30f72ed73c3b -- nosy: +python-dev resolution: not a bug - fixed stage: - resolved status: open - closed