[Python-ideas] Allow deleting slice in an OrderedDict

alex23 wuwei23 at gmail.com
Wed Dec 26 23:08:18 CET 2012


On Dec 27, 4:33 am, Ram Rachum <r... at rachum.com> wrote:
> My new proposed API: Build on `ItemsView` so we could do this: `del
> ordered_dict.items()[:2]` and have it delete the first 2 items from the
> ordered dict.

Modifying the return value of an object's method and having the object
itself mutate feels like a side-effect to me.



More information about the Python-ideas mailing list