[Python-ideas] Allow deleting slice in an OrderedDict

MRAB python at mrabarnett.plus.com
Thu Dec 27 00:47:49 CET 2012


On 2012-12-26 22:08, alex23 wrote:
> 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.
>
+1




More information about the Python-ideas mailing list