Re: del not working for (exhausted) dict iterable value (Python 3.3)

2013-03-12 Thread Nick Mellor
Thanks Alex! Nick -- http://mail.python.org/mailman/listinfo/python-list

Re: del not working for (exhausted) dict iterable value (Python 3.3)

2013-03-12 Thread Thomas Rachel
Am 12.03.2013 06:52 schrieb alex23: You're effectively doing this: event = dict(Items=[1,2,3]) for e in event['Items']: ... del event['Items'] ... Traceback (most recent call last): File stdin, line 2, in module KeyError: 'Items' You want to move your del statement up an indentation

del not working for (exhausted) dict iterable value (Python 3.3)

2013-03-11 Thread Nick Mellor
Hi all, event['Items'] is an exhausted (all used up) iterable. Now I do the following (lines 142-4): event.update({'Attributes': filtered_attributes}) del event['Items'] yield event and get a KeyError on the del statement. 'Items' is a key in the event

Re: del not working for (exhausted) dict iterable value (Python 3.3)

2013-03-11 Thread alex23
On Mar 12, 3:35 pm, Nick Mellor thebalance...@gmail.com wrote: event['Items'] is an exhausted (all used up) iterable. Now I do the following (lines 142-4):             event.update({'Attributes': filtered_attributes})             del event['Items']             yield event and get a