[issue9705] limit dict.update() to a given list of keys

2010-08-28 Thread Ultrasick
New submission from Ultrasick pyt...@ontheserver.de: my_dict_1 = {'a' : 1, 'b' : 1} my_dict_2 = {'a' : 2, 'b' : 2, 'c' : 2} my_dict_1.update(my_dict_2, ['a', 'c']) should result for my_dict_1: {'a' : 2, 'b' : 1, 'c' : 2} -- components: Interpreter Core messages: 115157 nosy:

[issue9705] limit dict.update() to a given list of keys

2010-08-28 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Please post to python-ideas first, and note a moratorium on builtin changes is inplace. -- nosy: +benjamin.peterson resolution: - rejected status: open - closed ___ Python tracker

[issue9705] limit dict.update() to a given list of keys

2010-08-28 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: FWIW, the usual way to spell this in Python is: my_dict_1.update((k, my_dict_2[k]) for k in ['a', 'c']) We try to keep filtering operations separate from map/fold operations for orthognality. -- nosy: +rhettinger