[Python-ideas] Add "default" kwarg to list.pop()
g.rodola at gmail.com
Tue Oct 30 19:44:55 EDT 2018
Sorry in advance if this has been proposed in the past but I couldn't find
anything on python-ideas:
>>> l = 
FWIW my use case consists in reading entries from /proc/diskstats where
lines can have a variable number of fields depending on the kernel version:
As such it would be convenient to set missing fields to 0 as "reads =
fields.pop(default=0)" instead of catching IndexError every time. Extra:
for consistency set.pop() should probably have the same.
Giampaolo - http://grodola.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas