Raymond Hettinger <[email protected]> added the comment:
Harry, thanks for the suggestion but we're going to pass for now.
For the most part, str.split() has stood the test of time and we use regexes
for more customized or complicated variants. In general, adding API options
increases complexity for users, making the basic methods harder to learn and
remember. Fewer choices tends to make for easier programming. Guido has
repeatedly given guidance to prefer separate functions and methods over putting
multiple algorithmic flags in a single function or method.
If you want to pursue this further, consider posting to the python-ideas list.
You'll find more traction if you're able to find real-world code that would
benefit from the new API.
One other thought: the API for the strip/lstrip/rstrip methods has the
equivalent of the *any* option when *chars* are specified. That has not worked
out well -- people get surprised when the methods strip more than the exact
string specified: 'there'.rstrip('re') --> 'th'.
----------
resolution: -> rejected
stage: -> resolved
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37620>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com