[vreg] rename select* object id argument to avoid name clash with arbitrary kwargs, just in case...
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 04 Aug 2010 11:16:39 +0200
changeset 6068 3bbc79a39d3a
parent 6067 efca814587e2
child 6069 d7cef08aad27
[vreg] rename select* object id argument to avoid name clash with arbitrary kwargs, just in case...
vregistry.py
--- a/vregistry.py	Wed Aug 04 11:16:38 2010 +0200
+++ b/vregistry.py	Wed Aug 04 11:16:39 2010 +0200
@@ -173,7 +173,7 @@
         assert len(objects) == 1, objects
         return objects[0](*args, **kwargs)
 
-    def select(self, oid, *args, **kwargs):
+    def select(self, __oid, *args, **kwargs):
         """return the most specific object among those with the given oid
         according to the given context.
 
@@ -181,14 +181,14 @@
 
         raise :exc:`NoSelectableObject` if not object apply
         """
-        return self._select_best(self[oid], *args, **kwargs)
+        return self._select_best(self[__oid], *args, **kwargs)
 
-    def select_or_none(self, oid, *args, **kwargs):
+    def select_or_none(self, __oid, *args, **kwargs):
         """return the most specific object among those with the given oid
         according to the given context, or None if no object applies.
         """
         try:
-            return self.select(oid, *args, **kwargs)
+            return self.select(__oid, *args, **kwargs)
         except (NoSelectableObject, ObjectNotFound):
             return None
     select_object = deprecated('[3.6] use select_or_none instead of select_object'