1. Pypy
  2. Untitled project
  3. pypy

Commits

Armin Rigo  committed 12b209c

Rename these two methods to their more precise meaning.

  • Participants
  • Parent commits a0a3570
  • Branches default

Comments (0)

Files changed (1)

File pypy/module/_weakref/interp__weakref.py

View file
  • Ignore whitespace
                                               'weakref callback of ')
 
     @jit.dont_look_inside
-    def get_or_make_weakref_with_callback(self, space, w_subtype, w_obj,
-                                          w_callable):
+    def make_weakref_with_callback(self, space, w_subtype, w_obj, w_callable):
         w_ref = space.allocate_instance(W_Weakref, w_subtype)
         W_Weakref.__init__(w_ref, space, w_obj, w_callable)
         self.refs_weak.append(weakref.ref(w_ref))
         return w_ref
 
     @jit.dont_look_inside
-    def get_or_make_proxy_with_callback(self, space, w_obj, w_callable):
+    def make_proxy_with_callback(self, space, w_obj, w_callable):
         if space.is_true(space.callable(w_obj)):
             w_proxy = W_CallableProxy(space, w_obj, w_callable)
         else:
         if not isinstance(lifeline, WeakrefLifelineWithCallbacks):  # or None
             lifeline = WeakrefLifelineWithCallbacks(space, oldlifeline)
             w_obj.setweakref(space, lifeline)
-        return lifeline.get_or_make_weakref_with_callback(space, w_subtype,
-                                                          w_obj, w_callable)
+        return lifeline.make_weakref_with_callback(space, w_subtype, w_obj,
+                                                   w_callable)
 
 W_Weakref.typedef = TypeDef("weakref",
     __doc__ = """A weak reference to an object 'obj'.  A 'callback' can be given,
         if not isinstance(lifeline, WeakrefLifelineWithCallbacks):  # or None
             lifeline = WeakrefLifelineWithCallbacks(space, oldlifeline)
             w_obj.setweakref(space, lifeline)
-        return lifeline.get_or_make_proxy_with_callback(space, w_obj,
-                                                        w_callable)
+        return lifeline.make_proxy_with_callback(space, w_obj, w_callable)
 
 def descr__new__proxy(space, w_subtype, w_obj, w_callable=None):
     raise OperationError(