[pypy-svn] r79787 - pypy/branch/fast-forward/pypy/module/cpyext

afa at codespeak.net afa at codespeak.net
Fri Dec 3 18:08:29 CET 2010


Author: afa
Date: Fri Dec  3 18:08:27 2010
New Revision: 79787

Modified:
   pypy/branch/fast-forward/pypy/module/cpyext/stubs.py
Log:
Remove from stubs.py already implemented functions


Modified: pypy/branch/fast-forward/pypy/module/cpyext/stubs.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/cpyext/stubs.py	(original)
+++ pypy/branch/fast-forward/pypy/module/cpyext/stubs.py	Fri Dec  3 18:08:27 2010
@@ -4,73 +4,34 @@
 from pypy.rpython.lltypesystem import rffi, lltype
 
 # we don't really care
-PyTypeObjectPtr = lltype.Void
-Py_ssize_t = lltype.Void
-PyMethodDef = lltype.Void
-PyGetSetDef = lltype.Void
-PyMemberDef = lltype.Void
-Py_buffer = lltype.Void
-Py_complex = lltype.Void
-va_list = lltype.Void
-PyDateTime_Date = lltype.Void
-PyDateTime_DateTime = lltype.Void
-PyDateTime_Time = lltype.Void
-wrapperbase = lltype.Void
-FILE = lltype.Void
-PyFileObject = lltype.Void
-PyCodeObject = lltype.Void
-PyFrameObject = lltype.Void
-_inittab = lltype.Void
-PyThreadState = lltype.Void
-PyInterpreterState = lltype.Void
-#PyOS_sighandler_t = lltype.Void
-Py_UNICODE = lltype.Void
-PyCompilerFlags = lltype.Void
-_node = lltype.Void
+PyTypeObjectPtr = rffi.VOIDP
+Py_ssize_t = rffi.VOIDP
+PyMethodDef = rffi.VOIDP
+PyGetSetDef = rffi.VOIDP
+PyMemberDef = rffi.VOIDP
+Py_buffer = rffi.VOIDP
+Py_complex = rffi.VOIDP
+va_list = rffi.VOIDP
+PyDateTime_Date = rffi.VOIDP
+PyDateTime_DateTime = rffi.VOIDP
+PyDateTime_Time = rffi.VOIDP
+wrapperbase = rffi.VOIDP
+FILE = rffi.VOIDP
+PyFileObject = rffi.VOIDP
+PyCodeObject = rffi.VOIDP
+PyFrameObject = rffi.VOIDP
+_inittab = rffi.VOIDP
+PyThreadState = rffi.VOIDP
+PyInterpreterState = rffi.VOIDP
+PyOS_sighandler_t = rffi.VOIDP
+Py_UNICODE = rffi.VOIDP
+PyCompilerFlags = rffi.VOIDP
+_node = rffi.VOIDP
 
 @cpython_api([PyObject], lltype.Void)
 def _PyObject_Del(space, op):
     raise NotImplementedError
 
- at cpython_api([rffi.CCHARP, PyMethodDef], PyObject)
-def Py_InitModule(space, name, methods):
-    """Create a new module object based on a name and table of functions,
-    returning the new module object.
-    
-    Older versions of Python did not support NULL as the value for the
-    methods argument."""
-    borrow_from()
-    raise NotImplementedError
-
- at cpython_api([rffi.CCHARP, PyMethodDef, rffi.CCHARP], PyObject)
-def Py_InitModule3(space, name, methods, doc):
-    """Create a new module object based on a name and table of functions,
-    returning the new module object.  If doc is non-NULL, it will be used
-    to define the docstring for the module.
-    
-    Older versions of Python did not support NULL as the value for the
-    methods argument."""
-    borrow_from()
-    raise NotImplementedError
-
- at cpython_api([PyObject, rffi.CCHARP, va_list], rffi.INT_real, error=0)
-def PyArg_VaParse(space, args, format, vargs):
-    """Identical to PyArg_ParseTuple(), except that it accepts a va_list
-    rather than a variable number of arguments."""
-    raise NotImplementedError
-
- at cpython_api([PyObject, PyObject, rffi.CCHARP, rffi.CCHARP, va_list], rffi.INT_real, error=0)
-def PyArg_VaParseTupleAndKeywords(space, args, kw, format, keywords, vargs):
-    """Identical to PyArg_ParseTupleAndKeywords(), except that it accepts a
-    va_list rather than a variable number of arguments."""
-    raise NotImplementedError
-
- at cpython_api([rffi.CCHARP, va_list], PyObject)
-def Py_VaBuildValue(space, format, vargs):
-    """Identical to Py_BuildValue(), except that it accepts a va_list
-    rather than a variable number of arguments."""
-    raise NotImplementedError
-
 @cpython_api([PyObject], rffi.INT_real, error=0)
 def PyObject_CheckBuffer(space, obj):
     """Return 1 if obj supports the buffer interface otherwise 0."""
@@ -261,11 +222,6 @@
     length.  Return 0 on success and -1 (with raising an error) on error."""
     raise NotImplementedError
 
- at cpython_api([PyObject], PyObject)
-def PyMemoryView_FromObject(space, obj):
-    """Return a memoryview object from an object that defines the buffer interface."""
-    raise NotImplementedError
-
 @cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
 def PyByteArray_Check(space, o):
     """Return true if the object o is a bytearray object or an instance of a
@@ -390,13 +346,6 @@
     version since the definition of the bytecode changes often."""
     raise NotImplementedError
 
- at cpython_api([rffi.CCHARP, rffi.CCHARP, rffi.INT_real], PyObject)
-def PyCode_NewEmpty(space, filename, funcname, firstlineno):
-    """Return a new empty code object with the specified filename,
-    function name, and first line number.  It is illegal to
-    exec or eval() the resulting code object."""
-    raise NotImplementedError
-
 @cpython_api([Py_complex, Py_complex], Py_complex)
 def _Py_c_sum(space, left, right):
     """Return the sum of two complex numbers, using the C Py_complex
@@ -714,13 +663,6 @@
     described there."""
     raise NotImplementedError
 
- at cpython_api([rffi.CCHARP, rffi.INT_real], rffi.INT_real, error=-1)
-def PyErr_WarnPy3k(space, message, stacklevel):
-    """Issue a DeprecationWarning with the given message and stacklevel
-    if the Py_Py3kWarningFlag flag is enabled.
-    """
-    raise NotImplementedError
-
 @cpython_api([], lltype.Void)
 def PyErr_SetInterrupt(space, ):
     """
@@ -746,14 +688,6 @@
     only be called from the main thread."""
     raise NotImplementedError
 
- at cpython_api([rffi.CCHARP, rffi.CCHARP, PyObject, PyObject], PyObject)
-def PyErr_NewExceptionWithDoc(space, name, doc, base, dict):
-    """Same as PyErr_NewException(), except that the new exception class can
-    easily be given a docstring: If doc is non-NULL, it will be used as the
-    docstring for the exception class.
-    """
-    raise NotImplementedError
-
 @cpython_api([PyObject], lltype.Void)
 def PyErr_WriteUnraisable(space, obj):
     """This utility function prints a warning message to sys.stderr when an
@@ -1053,22 +987,6 @@
     extension modules."""
     raise NotImplementedError
 
- at cpython_api([PyObject], lltype.Void)
-def Py_VISIT(space, o):
-    """Call the visit callback, with arguments o and arg. If visit returns
-    a non-zero value, then return it.  Using this macro, tp_traverse
-    handlers look like:
-    
-    static int
-    my_traverse(Noddy *self, visitproc visit, void *arg)
-    {
-        Py_VISIT(self->foo);
-        Py_VISIT(self->bar);
-        return 0;
-    }
-    """
-    raise NotImplementedError
-
 @cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
 def PyGen_Check(space, gen):
     """Return true if ob is a generator object; ob must not be NULL."""
@@ -1087,18 +1005,6 @@
     NULL."""
     raise NotImplementedError
 
- at cpython_api([rffi.CCHARP], PyObject)
-def PyImport_ImportModuleNoBlock(space, name):
-    """This version of PyImport_ImportModule() does not block. It's intended
-    to be used in C functions that import other modules to execute a function.
-    The import may block if another thread holds the import lock. The function
-    PyImport_ImportModuleNoBlock() never blocks. It first tries to fetch
-    the module from sys.modules and falls back to PyImport_ImportModule()
-    unless the lock is held, in which case the function will raise an
-    ImportError.
-    """
-    raise NotImplementedError
-
 @cpython_api([rffi.CCHARP, PyObject, PyObject, PyObject], PyObject)
 def PyImport_ImportModuleEx(space, name, globals, locals, fromlist):
     """
@@ -1879,29 +1785,6 @@
     """
     raise NotImplementedError
 
- at cpython_api([PyObject, Py_ssize_t], PyObject)
-def PyList_GET_ITEM(space, list, i):
-    """Macro form of PyList_GetItem() without error checking.
-    
-    This macro used an int for i. This might require changes in
-    your code for properly supporting 64-bit systems."""
-    borrow_from()
-    raise NotImplementedError
-
- at cpython_api([PyObject, Py_ssize_t, PyObject], lltype.Void)
-def PyList_SET_ITEM(space, list, i, o):
-    """Macro form of PyList_SetItem() without error checking. This is
-    normally only used to fill in new lists where there is no previous content.
-    
-    This macro "steals" a reference to item, and, unlike
-    PyList_SetItem(), does not discard a reference to any item that
-    it being replaced; any reference in list at position i will be
-    leaked.
-    
-    This macro used an int for i. This might require
-    changes in your code for properly supporting 64-bit systems."""
-    raise NotImplementedError
-
 @cpython_api([PyObject, Py_ssize_t, Py_ssize_t], PyObject)
 def PyList_GetSlice(space, list, low, high):
     """Return a list of the objects in list containing the objects between low
@@ -1941,30 +1824,6 @@
     changes in your code for properly supporting 64-bit systems."""
     raise NotImplementedError
 
- at cpython_api([PyObject, rffi.INTP], lltype.Signed, error=-1)
-def PyLong_AsLongAndOverflow(space, pylong, overflow):
-    """Return a C long representation of the contents of
-    pylong.  If pylong is greater than LONG_MAX or less
-    than LONG_MIN, set *overflow to 1 or -1,
-    respectively, and return -1; otherwise, set *overflow to
-    0.  If any other exception occurs (for example a TypeError or
-    MemoryError), then -1 will be returned and *overflow will
-    be 0.
-    """
-    raise NotImplementedError
-
- at cpython_api([PyObject, rffi.INTP], rffi.LONGLONG, error=-1)
-def PyLong_AsLongLongAndOverflow(space, pylong, overflow):
-    """Return a C long long representation of the contents of
-    pylong.  If pylong is greater than PY_LLONG_MAX or less
-    than PY_LLONG_MIN, set *overflow to 1 or -1,
-    respectively, and return -1; otherwise, set *overflow to
-    0.  If any other exception occurs (for example a TypeError or
-    MemoryError), then -1 will be returned and *overflow will
-    be 0.
-    """
-    raise NotImplementedError
-
 @cpython_api([PyObject], Py_ssize_t)
 def PyLong_AsSsize_t(space, pylong):
     """
@@ -1977,13 +1836,6 @@
     """
     raise NotImplementedError
 
- at cpython_api([PyObject], rffi.ULONGLONG, error=-1)
-def PyLong_AsUnsignedLongLongMask(space, io):
-    """Return a C unsigned long long from a Python long integer, without
-    checking for overflow.
-    """
-    raise NotImplementedError
-
 @cpython_api([PyObject, rffi.CCHARP], rffi.INT_real, error=-1)
 def PyMapping_DelItemString(space, o, key):
     """Remove the mapping for object key from the object o. Return -1 on
@@ -2415,20 +2267,6 @@
     changes in your code for properly supporting 64-bit systems."""
     raise NotImplementedError
 
- at cpython_api([PyObject], Py_ssize_t)
-def PyString_GET_SIZE(space, string):
-    """Macro form of PyString_Size() but without error checking.
-    
-    This macro returned an int type. This might require changes in
-    your code for properly supporting 64-bit systems."""
-    raise NotImplementedError
-
- at cpython_api([PyObject], rffi.CCHARP, error=CANNOT_FAIL)
-def PyString_AS_STRING(space, string):
-    """Macro form of PyString_AsString() but without error checking.  Only
-    string objects are supported; no Unicode objects should be passed."""
-    raise NotImplementedError
-
 @cpython_api([PyObjectP], lltype.Void)
 def PyString_InternInPlace(space, string):
     """Intern the argument *string in place.  The argument must be the address of a
@@ -2607,15 +2445,6 @@
     the cleanup function, no Python APIs should be called by func."""
     raise NotImplementedError
 
- at cpython_api([PyObject, Py_ssize_t], PyObject)
-def PyTuple_GET_ITEM(space, p, pos):
-    """Like PyTuple_GetItem(), but does no checking of its arguments.
-    
-    This function used an int type for pos. This might require
-    changes in your code for properly supporting 64-bit systems."""
-    borrow_from()
-    raise NotImplementedError
-
 @cpython_api([PyObject, Py_ssize_t, Py_ssize_t], PyObject)
 def PyTuple_GetSlice(space, p, low, high):
     """Take a slice of the tuple pointed to by p from low to high and return it
@@ -2625,17 +2454,6 @@
     require changes in your code for properly supporting 64-bit systems."""
     raise NotImplementedError
 
- at cpython_api([PyObject, Py_ssize_t, PyObject], lltype.Void)
-def PyTuple_SET_ITEM(space, p, pos, o):
-    """Like PyTuple_SetItem(), but does no error checking, and should only be
-    used to fill in brand new tuples.
-    
-    This function "steals" a reference to o.
-    
-    This function used an int type for pos. This might require
-    changes in your code for properly supporting 64-bit systems."""
-    raise NotImplementedError
-
 @cpython_api([], rffi.INT_real, error=CANNOT_FAIL)
 def PyTuple_ClearFreeList(space, ):
     """Clear the free list. Return the total number of freed items.
@@ -2656,12 +2474,6 @@
     """
     raise NotImplementedError
 
- at cpython_api([PyObject, rffi.INT_real], rffi.INT_real, error=CANNOT_FAIL)
-def PyType_HasFeature(space, o, feature):
-    """Return true if the type object o sets the feature feature.  Type features
-    are denoted by single bit flags."""
-    raise NotImplementedError
-
 @cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
 def PyType_IS_GC(space, o):
     """Return true if the type object includes support for the cycle detector; this



More information about the Pypy-commit mailing list