[pypy-commit] pypy default: Use __class__.__name__ directly here.

arigo noreply at buildbot.pypy.org
Wed Jul 9 18:37:51 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r72403:dab3b81bdd77
Date: 2014-07-09 18:36 +0200
http://bitbucket.org/pypy/pypy/changeset/dab3b81bdd77/

Log:	Use __class__.__name__ directly here.

diff --git a/pypy/module/__pypy__/interp_magic.py b/pypy/module/__pypy__/interp_magic.py
--- a/pypy/module/__pypy__/interp_magic.py
+++ b/pypy/module/__pypy__/interp_magic.py
@@ -73,21 +73,17 @@
     return space.wrap(42)
 
 
-def _nameof(cls):
-    return cls.__name__
-_nameof._annspecialcase_ = 'specialize:memo'
-
 def strategy(space, w_obj):
     """ strategy(dict or list or set)
 
     Return the underlying strategy currently used by a dict, list or set object
     """
     if isinstance(w_obj, W_DictMultiObject):
-        name = _nameof(w_obj.strategy.__class__)
+        name = w_obj.strategy.__class__.__name__
     elif isinstance(w_obj, W_ListObject):
-        name = _nameof(w_obj.strategy.__class__)
+        name = w_obj.strategy.__class__.__name__
     elif isinstance(w_obj, W_BaseSetObject):
-        name = _nameof(w_obj.strategy.__class__)
+        name = w_obj.strategy.__class__.__name__
     else:
         raise OperationError(space.w_TypeError,
                              space.wrap("expecting dict or list or set object"))


More information about the pypy-commit mailing list