[pypy-svn] r41122 - pypy/dist/pypy/doc

cfbolz at codespeak.net cfbolz at codespeak.net
Thu Mar 22 21:25:18 CET 2007


Author: cfbolz
Date: Thu Mar 22 21:25:16 2007
New Revision: 41122

Modified:
   pypy/dist/pypy/doc/__pypy__-module.txt
   pypy/dist/pypy/doc/objspace-proxies.txt
Log:
move thunk object space interface docs to objspace-proxies to be consistent
with the taint object space.


Modified: pypy/dist/pypy/doc/__pypy__-module.txt
==============================================================================
--- pypy/dist/pypy/doc/__pypy__-module.txt	(original)
+++ pypy/dist/pypy/doc/__pypy__-module.txt	Thu Mar 22 21:25:16 2007
@@ -21,20 +21,18 @@
 When the thunk object space is used (choose with :config:`objspace.name`),
 the following functions are put into ``__pypy__``:
 
- - ``thunk(f, *args, **kwargs)``: returns something that behaves like the result
-   of the call ``f(*args, **kwargs)`` but the call is done lazily.
+ - ``thunk``
+ - ``is_thunk``
+ - ``become``
+ - ``lazy``
 
- - ``is_thunk(obj)``: return True if ``obj`` is a thunk that is not computed
-   yet.
-
- - ``become(obj1, obj2)``: globally replace ``obj1`` with ``obj2``.
-
- - ``lazy(callable)``: Should be used as a function decorator. The decorated
-   function behaves lazily: all calls to it return a thunk object.
+Those are all described in the `interface section of the thunk object space
+docs`_.
 
 For explanations and examples see the `thunk object space docs`_.
 
 .. _`thunk object space docs`: objspace-proxies.html#thunk
+.. _`interface section of the thunk object space docs`: objspace-proxies.html#thunk-interface
 
 Taint Object Space Functionality
 ================================
@@ -50,13 +48,13 @@
  - ``_taint_look``
  - ``TaintError``
 
-Those are all described in the `interface section`_ of the taint object space
-docs.
+Those are all described in the `interface section of the taint object space
+docs`_.
 
 For more detailed explanations and examples see the `taint object space docs`_.
 
 .. _`taint object space docs`: objspace-proxies.html#taint
-.. _`interface section`: objspace-proxies.html#taint-interface
+.. _`interface section of the taint object space docs`: objspace-proxies.html#taint-interface
 
 Transparent Proxy Functionality
 ===============================

Modified: pypy/dist/pypy/doc/objspace-proxies.txt
==============================================================================
--- pypy/dist/pypy/doc/objspace-proxies.txt	(original)
+++ pypy/dist/pypy/doc/objspace-proxies.txt	Thu Mar 22 21:25:16 2007
@@ -95,6 +95,9 @@
     computing...
     [0, 900]
 
+Implementation
+--------------
+
 The implementation is short (see `pypy/objspace/thunk.py`_).  For the
 purpose of ``become()``, it adds an internal field `w_thunkalias` to
 each object, which is either None (in the common case) or a reference to
@@ -111,6 +114,25 @@
 the ``w_thunkalias`` field of the ``W_Thunk``, which has the effect of
 replacing the latter with the real value.
 
+.. _thunk-interface:
+
+Interface
+---------
+
+In a PyPy running with (or translated with) the Thunk Object Space,
+the ``__pypy__`` module exposes the following interface:
+
+ * ``thunk(f, *args, **kwargs)``: returns something that behaves like the result
+   of the call ``f(*args, **kwargs)`` but the call is done lazily.
+
+ * ``is_thunk(obj)``: return True if ``obj`` is a thunk that is not computed
+   yet.
+
+ * ``become(obj1, obj2)``: globally replace ``obj1`` with ``obj2``.
+
+ * ``lazy(callable)``: Should be used as a function decorator. The decorated
+   function behaves lazily: all calls to it return a thunk object.
+
 
 .. _logic:
 



More information about the Pypy-commit mailing list