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 gvanrossum
Recipients abarry, barry, gvanrossum, mrabarnett, rhettinger, serhiy.storchaka, syeberman, veky
Date 2016-12-12.16:16:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1481559366.77.0.00847882011175.issue28937@psf.upfronthosting.co.za>
In-reply-to
Content
I like the proposal. I agree that filter(None, ...) is not discoverable (and has its own magic).

So the proposal would be: prune=False -> empty strings stay, prune=True, empty strings are dropped, prune=None (default) use True if sep is None, False otherwise. Right?

Some end cases:

- ''.split(None, prune=True) -> ['']
- 'x  x'.split(None, prune=True) -> ['x', '', 'x']

Right?

While we're here I wish there was a specific argument we could translate .split(None) into, e.g. x.split() == x.split((' ', '\t', '\n', '\r', '\f')) # or whatever set of strings
History
Date User Action Args
2016-12-12 16:16:06gvanrossumsetrecipients: + gvanrossum, barry, rhettinger, syeberman, mrabarnett, serhiy.storchaka, veky, abarry
2016-12-12 16:16:06gvanrossumsetmessageid: <1481559366.77.0.00847882011175.issue28937@psf.upfronthosting.co.za>
2016-12-12 16:16:06gvanrossumlinkissue28937 messages
2016-12-12 16:16:06gvanrossumcreate