[pypy-svn] r10949 - pypy/dist/pypy/interpreter

pedronis at codespeak.net pedronis at codespeak.net
Thu Apr 21 04:12:11 CEST 2005


Author: pedronis
Date: Thu Apr 21 04:12:11 2005
New Revision: 10949

Modified:
   pypy/dist/pypy/interpreter/typedef.py
Log:
obj = interpclass_w(w_obj)
isinstance(obj, cls)
call and again
obj = interpclass_w(w_obj)

pattern defeats the annotator, avoid this sort of double interpclass_w. More to come




Modified: pypy/dist/pypy/interpreter/typedef.py
==============================================================================
--- pypy/dist/pypy/interpreter/typedef.py	(original)
+++ pypy/dist/pypy/interpreter/typedef.py	Thu Apr 21 04:12:11 2005
@@ -279,25 +279,21 @@
 descr_generic_ne = interp2app(generic_ne)
 
 # co_xxx interface emulation for built-in code objects
-def fget_co_varnames(space, w_code):
-    code = space.interpclass_w(w_code)
+def fget_co_varnames(space, code): # unwrapping through unwrap_spec
     return space.newtuple([space.wrap(name) for name in code.getvarnames()])
 
-def fget_co_argcount(space, w_code):
-    code = space.interpclass_w(w_code)
+def fget_co_argcount(space, code): # unwrapping through unwrap_spec
     argnames, varargname, kwargname = code.signature()
     return space.wrap(len(argnames))
 
-def fget_co_flags(space, w_code):
-    code = space.interpclass_w(w_code)
+def fget_co_flags(space, code): # unwrapping through unwrap_spec
     argnames, varargname, kwargname = code.signature()
     flags = 0
     if varargname is not None: flags |= CO_VARARGS
     if kwargname  is not None: flags |= CO_VARKEYWORDS
     return space.wrap(flags)
 
-def fget_co_consts(space, w_code):
-    code = space.interpclass_w(w_code)
+def fget_co_consts(space, code): # unwrapping through unwrap_spec
     w_docstring = space.wrap(code.getdocstring())
     return space.newtuple([w_docstring])
 



More information about the Pypy-commit mailing list