[Python-ideas] clear() method for lists
Nick Coghlan
ncoghlan at gmail.com
Fri Feb 12 10:58:09 CET 2010
George Sakkis wrote:
> Speaking of new potential list methods, how about list.get(index,
> default=None) ala dict.get ? I'm sure this has must have come up at
> some point but can't find it ATM.
I believe it runs afoul of the moratorium, but a getitem() builtin might
be a better idea (since it would then work for any class that implements
__getitem__).
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
---------------------------------------------------------------
More information about the Python-ideas
mailing list