Changes by Serhiy Storchaka storch...@gmail.com:
--
assignee: - serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18468
___
___
Roundup Robot added the comment:
New changeset add40e9f7cbe by Serhiy Storchaka in branch 'default':
Issue #18468: The re.split, re.findall, and re.sub functions and the group()
http://hg.python.org/cpython/rev/add40e9f7cbe
--
nosy: +python-dev
___
Serhiy Storchaka added the comment:
Thank you Antoine for your review.
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18468
Changes by Serhiy Storchaka storch...@gmail.com:
Removed file: http://bugs.python.org/file31737/re_group_type.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18468
___
Serhiy Storchaka added the comment:
Fixed a typo.
Could anyone please make a review?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18468
___
Changes by Serhiy Storchaka storch...@gmail.com:
Added file: http://bugs.python.org/file31939/re_group_type.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18468
___
Serhiy Storchaka added the comment:
Updated patch addressed Antoine's comments.
--
Added file: http://bugs.python.org/file31941/re_group_type_2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18468
Serhiy Storchaka added the comment:
Oh, seems I again did not attach a patch. Now I understand why there were no
any feedback so long time.
--
keywords: +needs review, patch
Added file: http://bugs.python.org/file31737/re_group_type.patch
___
Python
Serhiy Storchaka added the comment:
Here is a patch with an implementation and tests. Feel free to add a
documentation changes if needed.
--
stage: needs patch - patch review
___
Python tracker rep...@bugs.python.org
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18468
___
___
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18468
___
Ezio Melotti added the comment:
I'm not sure it's worth changing it.
As I see it, match/search are supposed to work with str or bytes and they
return str/bytes accordingly. The fact that they work with other bytes-like
objects seems to me an undocumented implementation detail people should
Matthew Barnett added the comment:
There's also the fact that the match object keeps a reference to the target
string anyway:
import re
t = memoryview(ba)
t
memory at 0x0100F110
m = re.match(ba, t)
m.string
memory at 0x0100F110
On that subject, buried in the source code (_sre.c) is the
Ezio Melotti added the comment:
match/search are supposed to work with str or bytes and
they return str/bytes accordingly.
s/they return/calling m.group() returns/
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18468
Guido van Rossum added the comment:
Ezio Melotti added the comment:
[...]
IIUC the advantage of changing the behavior is that it won't keep the target
string alive anymore, but on the other hand is not backward compatible and
makes things more difficult for people who want the same type
New submission from Guido van Rossum:
I discovered that the Python 3 version of
the re module's Match object behaves subtly different from the Python
2 version when the target string (i.e. the haystack, not the needle)
is a buffer object.
In Python 2, the type of the return value of group() is
16 matches
Mail list logo