[issue9137] x.update(red=5, blue=6, other=7) doesn't work, where x is a MutableMapping
Mark Dickinson dicki...@gmail.com added the comment: Fixed in r82821 (py3k), r82823 (release27-maint) and r82824 (release31-maint). -- stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9137] x.update(red=5, blue=6, other=7) doesn't work, where x is a MutableMapping
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: Just a nitpick: I think the code will be clearer if you switch on args' length rather than catch IndexError: nargs = len(args) if nargs 2: ... self = args[0] other = args[1] if nargs == 2 else () ... -- nosy: +belopolsky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9137] x.update(red=5, blue=6, other=7) doesn't work, where x is a MutableMapping
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9137] x.update(red=5, blue=6, other=7) doesn't work, where x is a MutableMapping
Mark Dickinson dicki...@gmail.com added the comment: Here's a fix. -- keywords: +patch nosy: +rhettinger Added file: http://bugs.python.org/file17834/issue9137.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9137] x.update(red=5, blue=6, other=7) doesn't work, where x is a MutableMapping
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: And what about this? x.update(self=5) -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9137] x.update(red=5, blue=6, other=7) doesn't work, where x is a MutableMapping
Mark Dickinson dicki...@gmail.com added the comment: Ah. Good point. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9137] x.update(red=5, blue=6, other=7) doesn't work, where x is a MutableMapping
Mark Dickinson dicki...@gmail.com added the comment: Updated patch, to deal with 'self' correctly too. -- stage: needs patch - patch review Added file: http://bugs.python.org/file17835/issue9137_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9137] x.update(red=5, blue=6, other=7) doesn't work, where x is a MutableMapping
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: stutzbach - mark.dickinson resolution: - accepted ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9137] x.update(red=5, blue=6, other=7) doesn't work, where x is a MutableMapping
New submission from Daniel Stutzbach dan...@stutzbachenterprises.com: Simple example, using collections.OrderedDict: import collections x = collections.OrderedDict() x.update(red=5, blue=6, other=7) Traceback (most recent call last): File stdin, line 1, in module File /usr/local/bin/../stow/Python-3.1.1/lib/python3.1/_abcoll.py, line 490, in update for key, value in other: TypeError: 'int' object is not iterable In MutableMapping.update, the first argument needs to be a positional-only argument. Otherwise, it's impossible to use other as keyword argument to designate a key-value pair. -- assignee: stutzbach messages: 109055 nosy: stutzbach priority: normal severity: normal stage: needs patch status: open title: x.update(red=5, blue=6, other=7) doesn't work, where x is a MutableMapping type: behavior versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com