Andrei Kulakov <andrei....@gmail.com> added the comment:

Just to sum up the current state the way I see it, as well as the history of 
the discussion, I think there were 2 initial requests based on experience and 
one additional, more theoretical "nice to have":

A. ''.split() => ['']
B. ''.split(sep) => []  # where sep!=None

C. a way to get the current semantics of sep=None, but with specific whitespace 
separators like just spaces or just tabs. 'a    b'.split(' ') => ['a','b']

The idea was to cover all 3 enhancements with the current patch.

As I pointed out in the comments above, current patch does not "cleanly" cover 
case B, potentially leading to confusion and/or bugs.

My suggestion was to cover cases A and B, and leave out C, potentially for some 
future patch.

If we go with the current patch, there will be no practical way to fix the 
issue with B later, other than adding a new `str.split2`. Conversely, it would 
be possible to add a new flag to handle C in the future.

This leads to a few questions:
- will the issue I brought up not really be a problem in practice?
- what's more important, B or C?
- if both B and C are important, can we leave C for a future patch?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue28937>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to