This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients ezio.melotti, mrabarnett, pitrou, serhiy.storchaka
Date 2015-01-18.18:20:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1421605238.49.0.672618974228.issue22818@psf.upfronthosting.co.za>
In-reply-to
Content
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 pretty small) frozen in the ages for backward compatibility. We can't change this behavior in maintained releases because this will break mach code which accidentally use zero-width patterns. But we can change it in future as new feature, after deprecating current behavior. This would be very useful feature. For example it would allow to simplify and speed up the regex used for splitting on hyphens in textwrap (something like r'(?<=\w-)(?=\w)').
History
Date User Action Args
2015-01-18 18:20:38serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, ezio.melotti, mrabarnett
2015-01-18 18:20:38serhiy.storchakasetmessageid: <1421605238.49.0.672618974228.issue22818@psf.upfronthosting.co.za>
2015-01-18 18:20:38serhiy.storchakalinkissue22818 messages
2015-01-18 18:20:38serhiy.storchakacreate