Message395926
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? |
|
Date |
User |
Action |
Args |
2021-06-16 14:27:14 | andrei.avk | set | recipients:
+ andrei.avk, gvanrossum, barry, syeberman, mrabarnett, karlcow, serhiy.storchaka, Catherine.Devlin, Mark.Bell, veky, cheryl.sabella, corona10, ZackerySpytz, Philippe Cloutier |
2021-06-16 14:27:14 | andrei.avk | set | messageid: <1623853634.21.0.108900308599.issue28937@roundup.psfhosted.org> |
2021-06-16 14:27:14 | andrei.avk | link | issue28937 messages |
2021-06-16 14:27:13 | andrei.avk | create | |
|