From e11de525528b181242e54ef0a6af6a6670759c6f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 5 Mar 2009 04:19:07 +0000 Subject: Make the first argument of update() methods be an optional positional argument instead of a keyword argument. svn path=/main/trunk/; revision=12755 --- pym/portage/cache/mappings.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'pym/portage/cache/mappings.py') 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'): -- cgit v1.2.3-1-g7c22