[pypy-svn] r10048 - pypy/dist/pypy/objspace

arigo at codespeak.net arigo at codespeak.net
Tue Mar 22 02:26:53 CET 2005


Author: arigo
Date: Tue Mar 22 02:26:53 2005
New Revision: 10048

Modified:
   pypy/dist/pypy/objspace/thunk.py
Log:
added is_thunk() in the thunk objspace.

Modified: pypy/dist/pypy/objspace/thunk.py
==============================================================================
--- pypy/dist/pypy/objspace/thunk.py	(original)
+++ pypy/dist/pypy/objspace/thunk.py	Tue Mar 22 02:26:53 2005
@@ -45,6 +45,10 @@
                                                    baseobjspace.W_Root,
                                                    argument.Arguments])
 
+def is_thunk(space, w_obj):
+    return space.newbool(isinstance(w_obj, W_Thunk))
+app_is_thunk = gateway.interp2app(is_thunk)
+
 # __________________________________________________________________________
 
 operation_args_that_dont_force = {
@@ -67,4 +71,6 @@
     space = create_proxy_space('thunk', proxymaker, space=space)
     space.setitem(space.builtin.w_dict, space.wrap('thunk'),
                   space.wrap(app_thunk))
+    space.setitem(space.builtin.w_dict, space.wrap('is_thunk'),
+                  space.wrap(app_is_thunk))
     return space



More information about the Pypy-commit mailing list