Message395167
Mark:
With sep=None, I don't think there is an issue. My only concern is when sep is set to some other value.
The original issue was that the single empty str result is removed when using sep=None and that it's kept when sep is some other value. So the most direct solution would seem to be to have a flag that controls the removal/retention of a single empty str in results.
Instead, the discussion was focused on removing *all* empty strings from the result.
My concern is that this doesn't solve the original issue in some cases, i.e. if I want to use a sep other than None, and I want an empty line to mean there are no values (result=[]), but I do want to keep empty values (a,, => [a,'','']) -- all of these seem like fairly normal, not unusual requirements.
The second concern, as I noted in previous message, is a potential for bugs if this flag being interpreted narrowly as a solution for the original issue only.
[Note I don't think it would be a very widespread bug but I can see it happening occasionally.]
I think to avoid both of these issues we could change the flag to narrowly target the original issue, i.e. one empty str only. The name of the flag can remain the same or possibly something like `keep_single_empty` would be more explicit (though a bit awkward).
The downside is that we'd lose the convenience of splitting and filtering out all empties in one operation.
Sorry that I bring this up only now when the discussion was finished and the work on PR completed; I wish I had seen the issue sooner. |
|
Date |
User |
Action |
Args |
2021-06-05 15:43:11 | 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-05 15:43:11 | andrei.avk | set | messageid: <1622907791.48.0.686953177717.issue28937@roundup.psfhosted.org> |
2021-06-05 15:43:11 | andrei.avk | link | issue28937 messages |
2021-06-05 15:43:11 | andrei.avk | create | |
|