[pypy-svn] r38454 - pypy/dist/pypy/module/__builtin__

xoraxax at codespeak.net xoraxax at codespeak.net
Sun Feb 11 14:17:45 CET 2007


Author: xoraxax
Date: Sun Feb 11 14:17:44 2007
New Revision: 38454

Modified:
   pypy/dist/pypy/module/__builtin__/operation.py
Log:
Speedup the access to the recursion limit in isinstance.

Modified: pypy/dist/pypy/module/__builtin__/operation.py
==============================================================================
--- pypy/dist/pypy/module/__builtin__/operation.py	(original)
+++ pypy/dist/pypy/module/__builtin__/operation.py	Sun Feb 11 14:17:44 2007
@@ -262,9 +262,7 @@
     """Check whether a class 'cls' is a subclass (i.e., a derived class) of
 another class.  When using a tuple as the second argument, check whether
 'cls' is a subclass of any of the classes listed in the tuple."""
-    w_getlimit = space.getattr(space.getbuiltinmodule('sys'), space.wrap('getrecursionlimit'))
-    w_limit = space.call_function(w_getlimit, )
-    return space.wrap(_issubclass(space, w_cls, w_klass_or_tuple, True, space.int_w(w_limit)))
+    return space.wrap(_issubclass(space, w_cls, w_klass_or_tuple, True, space.sys.recursionlimit))
 
 
 def isinstance(space, w_obj, w_klass_or_tuple):
@@ -284,7 +282,5 @@
     if space.is_w(w_objcls, space.type(w_obj)):
         return space.w_False
     else:
-        w_getlimit = space.getattr(space.getbuiltinmodule('sys'), space.wrap('getrecursionlimit'))
-        limit = space.int_w(space.call_function(w_getlimit, ))
-        return space.wrap(_issubclass(space, w_objcls, w_klass_or_tuple, False, limit))
+        return space.wrap(_issubclass(space, w_objcls, w_klass_or_tuple, False, space.sys.recursionlimit))
 



More information about the Pypy-commit mailing list