[issue22818] Deprecate splitting on possible zero-width re patterns

2015-02-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7c667d8ae10d by Serhiy Storchaka in branch 'default': Issue #22818: Splitting on a pattern that could match an empty string now https://hg.python.org/cpython/rev/7c667d8ae10d -- nosy: +python-dev ___

[issue22818] Deprecate splitting on possible zero-width re patterns

2015-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Ezio and Berker for your reviews. -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22818

[issue22818] Deprecate splitting on possible zero-width re patterns

2015-02-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be RuntimeWarning or FutureWarning are more appropriate? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22818 ___

[issue22818] Deprecate splitting on possible zero-width re patterns

2015-02-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I hesitate about warning type. Originally I was going to emit a DeprecationWarning in 3.5, may be change it to a UserWarning in 3.6, and raise a ValueError or change behavior in 3.7. What would be better? -- ___

[issue22818] Deprecate splitting on possible zero-width re patterns

2015-02-01 Thread Ezio Melotti
Ezio Melotti added the comment: DeprecationWarning: Base class for warnings about deprecated features. UserWarning: Base class for warnings generated by user code. RuntimeWarning: Base class for warnings about dubious runtime behavior. FutureWarning: Base class for warnings about constructs that

[issue22818] Deprecate splitting on possible zero-width re patterns

2015-01-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Ezio for your review. Updated patch includes most of your suggestions. But I think some places still can be dim. -- Added file: http://bugs.python.org/file37863/re_deprecate_split_zero_width_3.patch ___

[issue22818] Deprecate splitting on possible zero-width re patterns

2015-01-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated patch includes Ezio's suggestions. Thank you Ezio, they looks great to me. -- Added file: http://bugs.python.org/file37864/re_deprecate_split_zero_width_4.patch ___ Python tracker rep...@bugs.python.org

[issue22818] Deprecate splitting on possible zero-width re patterns

2015-01-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could anyone please make a review (mainly documentation)? It would be good to get this change in first alpha. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22818

[issue22818] Deprecate splitting on possible zero-width re patterns

2015-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Now patterns which could match only an empty string (e.g. '(?m)^$' or '(?=\w-)(?=\w)') are rejected at all. They never worked with current regex engine. Updated the documentation. Could anyone please make a review and correct my wording. It is desirable to

[issue22818] Deprecate splitting on possible zero-width re patterns

2015-01-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't really understand why this is definitely a bug. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22818 ___

[issue22818] Deprecate splitting on possible zero-width re patterns

2015-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Because users expect that split() supports zero-width patterns (as sub() supports them) and regexps in other languages support splitting on zero-width patterns. This looks as accidental implementation detail (see my patch in issue22817 -- the difference is

[issue22818] Deprecate splitting on possible zero-width re patterns

2014-12-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I there are no objections I'm going to commit the patch soon. -- assignee: - serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22818 ___

[issue22818] Deprecate splitting on possible zero-width re patterns

2014-11-08 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: For now re.split doesn't split with zero-width regex. There are a number of issues for this (issue852532, issue988761, issue3262, issue22817). This is definitely a bug, but fixing this bug will likely break existing code which use regular expressions