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 Mark.Bell
Recipients Catherine.Devlin, Mark.Bell, Philippe Cloutier, ZackerySpytz, andrei.avk, barry, cheryl.sabella, corona10, gvanrossum, karlcow, mrabarnett, serhiy.storchaka, syeberman, veky
Date 2021-06-05.20:18:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1622924314.6.0.661161073114.issue28937@roundup.psfhosted.org>
In-reply-to
Content
> Instead, the discussion was focused on removing *all* empty strings from the result.

I imagine that the discussion focussed on this since this is precisely what happens when sep=None. For example, 'a     b   c     ​'.split() == ['a', 'b', 'c']. I guess that the point was to provide users with explicit, manual control over whether the behaviour of split should drop all empty strings or retain all empty strings instead of this decision just being made on whether sep is None or not.

So I wonder whether the "expected" solution for parsing CSV like strings is for you to actually filter out the empty strings yourself and never pass them to split at all. For example by doing something like:

[line.split(sep=',') for line in content.splitlines() if line]

but if this is the case then this is the kind of thing that would require careful thought about what is the right name for this parameter / right way to express this in the documentation to make sure that users don't fall into the trap that you mentioned.

> 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.

Of course, but the main thing is that you spotted this before the PR was merged :)
History
Date User Action Args
2021-06-05 20:18:34Mark.Bellsetrecipients: + Mark.Bell, gvanrossum, barry, syeberman, mrabarnett, karlcow, serhiy.storchaka, Catherine.Devlin, veky, cheryl.sabella, corona10, ZackerySpytz, Philippe Cloutier, andrei.avk
2021-06-05 20:18:34Mark.Bellsetmessageid: <1622924314.6.0.661161073114.issue28937@roundup.psfhosted.org>
2021-06-05 20:18:34Mark.Belllinkissue28937 messages
2021-06-05 20:18:34Mark.Bellcreate