summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-11 06:42:01 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-11 06:42:01 +0000
commit919dd41724020e73df024d2ec37c3a84caef28b3 (patch)
tree89461a1696395ad75c6c3ee5e731fa8982a244cc /pym
parenta2428c1adadde5412db632afec2f8626f33835fe (diff)
downloadportage-919dd41724020e73df024d2ec37c3a84caef28b3.tar.gz
portage-919dd41724020e73df024d2ec37c3a84caef28b3.tar.bz2
portage-919dd41724020e73df024d2ec37c3a84caef28b3.zip
Make the first argument of update() methods be an optional positional argument
instead of a keyword argument. (trunk r12755) svn path=/main/branches/2.1.6/; revision=13003
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/cache/mappings.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/pym/portage/cache/mappings.py b/pym/portage/cache/mappings.py
index 1117b855b..77923b462 100644
--- a/pym/portage/cache/mappings.py
+++ b/pym/portage/cache/mappings.py
@@ -111,7 +111,14 @@ class MutableMapping(Mapping):
del self[k]
return (k, v)
- def update(self, other=None, **kwargs):
+ def update(self, *args, **kwargs):
+ if len(args) > 1:
+ raise TypeError(
+ "expected at most 1 positional argument, got " + \
+ repr(len(args)))
+ other = None
+ if args:
+ other = args[0]
if other is None:
pass
elif hasattr(other, 'iteritems'):
@@ -369,7 +376,14 @@ def slot_dict_class(keys, prefix="_val_"):
self[key] = default
return default
- def update(self, other=None, **kwargs):
+ def update(self, *args, **kwargs):
+ if len(args) > 1:
+ raise TypeError(
+ "expected at most 1 positional argument, got " + \
+ repr(len(args)))
+ other = None
+ if args:
+ other = args[0]
if other is None:
pass
elif hasattr(other, 'iteritems'):