[pypy-svn] rev 1413 - pypy/trunk/doc/objspace

arigo at codespeak.net arigo at codespeak.net
Tue Sep 23 15:32:58 CEST 2003


Author: arigo
Date: Tue Sep 23 15:32:57 2003
New Revision: 1413

Modified:
   pypy/trunk/doc/objspace/objspaceinterface.txt
Log:
Updated this document


Modified: pypy/trunk/doc/objspace/objspaceinterface.txt
==============================================================================
--- pypy/trunk/doc/objspace/objspaceinterface.txt	(original)
+++ pypy/trunk/doc/objspace/objspaceinterface.txt	Tue Sep 23 15:32:57 2003
@@ -2,23 +2,11 @@
 PyPython ObjectSpaceInterface
 ================================
 
-Note this is only a draft version of the ObjectSpace_ interface. The reality of the interface depends on the particular implementation you are using. Consult the code for details.
+This is a draft version of the ObjectSpace_ interface. It is still evolving, although the public interface is not evolving as much as the internal interface that subclasses need to know about. This document now generally refers to the public interface; for subclassing you need to poke at the code in detail anyway.
 
-class ObjSpace
-=================
 
-Data Members
------------------
-
-+ ObjSpace.MethodTable:
-   List of tuples (method name, symbol, number of arguments) for the regular part of the interface. (Tuples are interpreter level.)
-
-+ self.w_builtins
-+ self.w_modules
-+ self.appfile_helpers
-+ self.w_None: The ObjectSpace's None
-+ self.w_True: The ObjectSpace's True
-+ self.w_False: The ObjectSpace's False
+class baseobjspace.ObjSpace
+===========================
 
 Administrative Functions
 ----------------------------
@@ -29,9 +17,6 @@
 **getexecutioncontext():**
   Return current active execution context.
 
-**gethelper(applicationfile):**
-  Get helper for applicationfile.
-
 Operations on Objects in ObjectSpace
 -----------------------------------------
 
@@ -45,27 +30,37 @@
 
 ``pos, neg, not_, abs, invert, add, sub, mul, truediv, floordiv, div, mod, divmod, pow, lshift, rshift, and_, or_, xor,``
 
+``hex, oct, int, float, ord,``
+
 ``lt, le, eq, ne, gt, ge, contains,``
 
-``inplace_add, inplace_sub, inplace_mul, inplace_truediv, inplace_floordiv, inplace_div, inplace_mod, inplace_pow, inplace_lshift, inplace_rshift, inplace_and, inplace_or, inplace_xor``
+``inplace_add, inplace_sub, inplace_mul, inplace_truediv, inplace_floordiv, inplace_div, inplace_mod, inplace_pow, inplace_lshift, inplace_rshift, inplace_and, inplace_or, inplace_xor,``
+
+``get, set, delete``
 
 **next(w):**
-  Call the next function for iterator w.
+  Call the next function for iterator w, or raises a real NoValue.
 
-**call(callable, args, kwds):**
+**call(w_callable, w_args, w_kwds):**
   Call a function with the given args and keywords.
 
+**call_function(w_callable, *args_w, **kw_w):**
+  Convenience function that collects the arguments in a wrapped tuple and dict and invokes 'call()'.
+
 **is_(w_x, w_y):**
-  Implements 'w_x is w_y'.
+  Implements 'w_x is w_y'. (Returns a wrapped result too!)
+
+**isinstance(w_obj, w_type):**
+  Implements 'issubtype(type(w_obj), w_type)'. (Returns a wrapped result too!)
 
 **exception_match(w_exc_type, w_check_class):**
-  Checks if the given exception type matches 'w_check_class'. Used in matching the actual exception raised with the list of those to catch in an except clause. Returns a bool.
+  Checks if the given exception type matches 'w_check_class'. Used in matching the actual exception raised with the list of those to catch in an except clause. (Returns a wrapped result too!)
 
 Creation of Application Level objects
 ---------------------------------------
 
 **wrap(x):**
-  Return ObjectSpace equivalent of x.
+  Returns a wrapped object that is a reference to the interpreter-level object x. This can be used either on simple immutable objects (integers, strings...) to create a new wrapped object, or on complex mutable objects to obtain an application-level-visible reference to them (e.g. instances of internal interpreter classes).
 
 **newbool(b):**
   Creates a Bool Object from an interpreter level object.
@@ -77,19 +72,13 @@
   Takes an interpreter level list of wrapped objects.
 
 **newdict([..]):**
-  Takes an interpreter level list of interpreter level pairs of wrapped key:wrapped value entries.
+  Takes an interpreter level list of interpreter level pairs of wrapped key:wrapped value entries (and NOT an interpreter level dictionary!).
 
 **newslice(w_start, w_end, w_step):**
   Makes a new slice object.
 
-**newfunction(w_code, w_globals, w_defaultarguments, w_closure=None):**
-  Creates a new function object.
-
 **newstring(asciilist):**
-  Creates a string from a list of integers.
-
-**newmodule(w_name):**
-  Creates a new module with a given name.
+  Creates a string from a list of wrapped integers.
 
 Conversions from Application Level to Interpreter Level
 ----------------------------------------------------------
@@ -108,4 +97,31 @@
 
 ---------------------------
 
+
+
+Data Members
+-----------------
+
++ self.w_builtins
++ self.w_modules
++ self.w_None: The ObjectSpace's None
++ self.w_True: The ObjectSpace's True
++ self.w_False: The ObjectSpace's False
++ self.w_Ellipsis: The ObjectSpace's Ellipsis
++ self.w_NotImplemented: The ObjectSpace's NotImplemented
+
++ ObjSpace.MethodTable:
+   List of tuples (method name, symbol, number of arguments, list of special names) for the regular part of the interface. (Tuples are interpreter level.)
+
++ ObjSpace.BuiltinModuleTable:
+   List of names of built-in modules.
+
++ ObjSpace.ConstantTable:
+   List of names of the constants that the object space should define
+
++ ObjSpace.ExceptionTable:
+   List of names of exception classes.
+
+---------------------------
+
 .. _ObjectSpace: objspace.html


More information about the Pypy-commit mailing list