[pypy-svn] r41002 - in pypy/dist/pypy/objspace: . std
cfbolz at codespeak.net
cfbolz at codespeak.net
Thu Mar 22 00:30:53 CET 2007
Author: cfbolz
Date: Thu Mar 22 00:30:52 2007
New Revision: 41002
Modified:
pypy/dist/pypy/objspace/std/transparent.py
pypy/dist/pypy/objspace/thunk.py
Log:
some more doc strings
Modified: pypy/dist/pypy/objspace/std/transparent.py
==============================================================================
--- pypy/dist/pypy/objspace/std/transparent.py (original)
+++ pypy/dist/pypy/objspace/std/transparent.py Thu Mar 22 00:30:52 2007
@@ -9,6 +9,9 @@
from pypy.objspace.std.typeobject import W_TypeObject
def proxy(space, w_type, w_controller):
+ """tproxy(typ, controller) -> obj
+Return something that looks like it is of type typ. It's behaviour is
+completely controlled by the controller."""
from pypy.interpreter.typedef import Function, PyTraceback, PyFrame, \
PyCode, GeneratorIterator
@@ -39,6 +42,9 @@
"be wrapped (YET)" % w_type.getname(space, "?")))
def proxy_controller(space, w_object):
+ """get_tproxy_controller(obj) -> controller
+If obj is really a transparent proxy, return its controller. Otherwise return
+None."""
if isinstance(w_object, W_Transparent):
return w_object.w_controller
if isinstance(w_object, W_TransparentObject):
Modified: pypy/dist/pypy/objspace/thunk.py
==============================================================================
--- pypy/dist/pypy/objspace/thunk.py (original)
+++ pypy/dist/pypy/objspace/thunk.py Thu Mar 22 00:30:52 2007
@@ -97,6 +97,7 @@
app_become = gateway.interp2app(become)
def lazy(space, w_callable):
+ """Decorator to make a callable return its results wrapped in a thunk."""
meth = Method(space, space.w_fn_thunk,
w_callable, space.type(w_callable))
return space.wrap(meth)
More information about the Pypy-commit
mailing list