Message283019
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 |
|
Date |
User |
Action |
Args |
2016-12-12 16:16:06 | gvanrossum | set | recipients:
+ gvanrossum, barry, rhettinger, syeberman, mrabarnett, serhiy.storchaka, veky, abarry |
2016-12-12 16:16:06 | gvanrossum | set | messageid: <1481559366.77.0.00847882011175.issue28937@psf.upfronthosting.co.za> |
2016-12-12 16:16:06 | gvanrossum | link | issue28937 messages |
2016-12-12 16:16:06 | gvanrossum | create | |
|