[pypy-svn] r74194 - pypy/branch/cpython-extension/pypy/module/cpyext
afa at codespeak.net
afa at codespeak.net
Wed Apr 28 19:47:24 CEST 2010
Author: afa
Date: Wed Apr 28 19:47:23 2010
New Revision: 74194
Modified:
pypy/branch/cpython-extension/pypy/module/cpyext/stubs.py
Log:
remove from stubs already implemented functions
Modified: pypy/branch/cpython-extension/pypy/module/cpyext/stubs.py
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/stubs.py (original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/stubs.py Wed Apr 28 19:47:23 2010
@@ -51,260 +51,18 @@
methods argument."""
raise NotImplementedError
- at cpython_api([PyObject, rffi.CCHARP, ], rffi.INT_real, error=0)
-def PyArg_ParseTuple(space, args, format, ):
- """Parse the parameters of a function that takes only positional parameters
- into local variables. Returns true on success; on failure, it returns
- false and raises the appropriate exception."""
- raise NotImplementedError
-
@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, ], rffi.INT_real, error=0)
-def PyArg_ParseTupleAndKeywords(space, args, kw, format, keywords, ):
- """Parse the parameters of a function that takes both positional and keyword
- parameters into local variables. Returns true on success; on failure, it
- returns false and raises the appropriate exception."""
- raise NotImplementedError
-
@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([PyObject, rffi.CCHARP, ], rffi.INT_real, error=0)
-def PyArg_Parse(space, args, format, ):
- """Function used to deconstruct the argument lists of "old-style" functions
- --- these are functions which use the METH_OLDARGS parameter
- parsing method. This is not recommended for use in parameter parsing in
- new code, and most code in the standard interpreter has been modified to no
- longer use this for that purpose. It does remain a convenient way to
- decompose other tuples, however, and may continue to be used for that
- purpose."""
- raise NotImplementedError
-
- at cpython_api([PyObject, rffi.CCHARP, Py_ssize_t, Py_ssize_t, ], rffi.INT_real, error=0)
-def PyArg_UnpackTuple(space, args, name, min, max, ):
- """A simpler form of parameter retrieval which does not use a format string to
- specify the types of the arguments. Functions which use this method to
- retrieve their parameters should be declared as METH_VARARGS in
- function or method tables. The tuple containing the actual parameters
- should be passed as args; it must actually be a tuple. The length of the
- tuple must be at least min and no more than max; min and max may be
- equal. Additional arguments must be passed to the function, each of which
- should be a pointer to a PyObject* variable; these will be filled
- in with the values from args; they will contain borrowed references. The
- variables which correspond to optional parameters not given by args will
- not be filled in; these should be initialized by the caller. This function
- returns true on success and false if args is not a tuple or contains the
- wrong number of elements; an exception will be set if there was a failure.
-
- This is an example of the use of this function, taken from the sources for
- the _weakref helper module for weak references:
-
- static PyObject *
- weakref_ref(PyObject *self, PyObject *args)
- {
- PyObject *object;
- PyObject *callback = NULL;
- PyObject *result = NULL;
-
- if (PyArg_UnpackTuple(args, "ref", 1, 2, &object, &callback)) {
- result = PyWeakref_NewRef(object, callback);
- }
- return result;
- }
-
- The call to PyArg_UnpackTuple() in this example is entirely
- equivalent to this call to PyArg_ParseTuple():
-
- PyArg_ParseTuple(args, "O|O:ref", &object, &callback)
-
-
-
- This function used an int type for min and max. This might
- require changes in your code for properly supporting 64-bit systems."""
- raise NotImplementedError
-
- at cpython_api([rffi.CCHARP, ], PyObject)
-def Py_BuildValue(space, format, ):
- """Create a new value based on a format string similar to those accepted by
- the PyArg_Parse*() family of functions and a sequence of values.
- Returns the value or NULL in the case of an error; an exception will be
- raised if NULL is returned.
-
- Py_BuildValue() does not always build a tuple. It builds a tuple
- only if its format string contains two or more format units. If the format
- string is empty, it returns None; if it contains exactly one format
- unit, it returns whatever object is described by that format unit. To
- force it to return a tuple of size 0 or one, parenthesize the format
- string.
-
- When memory buffers are passed as parameters to supply data to build
- objects, as for the s and s# formats, the required data is copied.
- Buffers provided by the caller are never referenced by the objects created
- by Py_BuildValue(). In other words, if your code invokes
- malloc() and passes the allocated memory to Py_BuildValue(),
- your code is responsible for calling free() for that memory once
- Py_BuildValue() returns.
-
- In the following description, the quoted form is the format unit; the entry
- in (round) parentheses is the Python object type that the format unit will
- return; and the entry in [square] brackets is the type of the C value(s) to
- be passed.
-
- The characters space, tab, colon and comma are ignored in format strings
- (but not within format units such as s#). This can be used to make
- long format strings a tad more readable.
-
- s (string) [char *]
-
- Convert a null-terminated C string to a Python object. If the C string
- pointer is NULL, None is used.
-
- s# (string) [char *, int]
-
- Convert a C string and its length to a Python object. If the C string
- pointer is NULL, the length is ignored and None is returned.
-
- z (string or None) [char *]
-
- Same as s.
-
- z# (string or None) [char *, int]
-
- Same as s#.
-
- u (Unicode string) [Py_UNICODE *]
-
- Convert a null-terminated buffer of Unicode (UCS-2 or UCS-4) data to a
- Python Unicode object. If the Unicode buffer pointer is NULL,
- None is returned.
-
- u# (Unicode string) [Py_UNICODE *, int]
-
- Convert a Unicode (UCS-2 or UCS-4) data buffer and its length to a
- Python Unicode object. If the Unicode buffer pointer is NULL, the
- length is ignored and None is returned.
-
- i (integer) [int]
-
- Convert a plain C int to a Python integer object.
-
- b (integer) [char]
-
- Convert a plain C char to a Python integer object.
-
- h (integer) [short int]
-
- Convert a plain C short int to a Python integer object.
-
- l (integer) [long int]
-
- Convert a C long int to a Python integer object.
-
- B (integer) [unsigned char]
-
- Convert a C unsigned char to a Python integer object.
-
- H (integer) [unsigned short int]
-
- Convert a C unsigned short int to a Python integer object.
-
- I (integer/long) [unsigned int]
-
- Convert a C unsigned int to a Python integer object or a Python
- long integer object, if it is larger than sys.maxint.
-
- k (integer/long) [unsigned long]
-
- Convert a C unsigned long to a Python integer object or a
- Python long integer object, if it is larger than sys.maxint.
-
- L (long) [PY_LONG_LONG]
-
- Convert a C long long to a Python long integer object. Only
- available on platforms that support long long.
-
- K (long) [unsigned PY_LONG_LONG]
-
- Convert a C unsigned long long to a Python long integer object.
- Only available on platforms that support unsigned long long.
-
- n (int) [Py_ssize_t]
-
- Convert a C Py_ssize_t to a Python integer or long integer.
-
-
-
- c (string of length 1) [char]
-
- Convert a C int representing a character to a Python string of
- length 1.
-
- d (float) [double]
-
- Convert a C double to a Python floating point number.
-
- f (float) [float]
-
- Same as d.
-
- D (complex) [Py_complex *]
-
- Convert a C Py_complex structure to a Python complex number.
-
- O (object) [PyObject *]
-
- Pass a Python object untouched (except for its reference count, which is
- incremented by one). If the object passed in is a NULL pointer, it is
- assumed that this was caused because the call producing the argument
- found an error and set an exception. Therefore, Py_BuildValue()
- will return NULL but won't raise an exception. If no exception has
- been raised yet, SystemError is set.
-
- S (object) [PyObject *]
-
- Same as O.
-
- N (object) [PyObject *]
-
- Same as O, except it doesn't increment the reference count on the
- object. Useful when the object is created by a call to an object
- constructor in the argument list.
-
- O& (object) [converter, anything]
-
- Convert anything to a Python object through a converter function.
- The function is called with anything (which should be compatible with
- void *) as its argument and should return a "new" Python
- object, or NULL if an error occurred.
-
- (items) (tuple) [matching-items]
-
- Convert a sequence of C values to a Python tuple with the same number of
- items.
-
- [items] (list) [matching-items]
-
- Convert a sequence of C values to a Python list with the same number of
- items.
-
- {items} (dictionary) [matching-items]
-
- Convert a sequence of C values to a Python dictionary. Each pair of
- consecutive C values adds one item to the dictionary, serving as key and
- value, respectively.
-
- If there is an error in the format string, the SystemError exception
- is set and NULL returned."""
- raise NotImplementedError
-
@cpython_api([rffi.CCHARP, va_list], PyObject)
def Py_VaBuildValue(space, format, vargs):
"""Identical to Py_BuildValue(), except that it accepts a va_list
@@ -507,71 +265,6 @@
raise NotImplementedError
@cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
-def PyBuffer_Check(space, p):
- """Return true if the argument has type PyBuffer_Type."""
- raise NotImplementedError
-
- at cpython_api([PyObject, Py_ssize_t, Py_ssize_t], PyObject)
-def PyBuffer_FromObject(space, base, offset, size):
- """Return a new read-only buffer object. This raises TypeError if
- base doesn't support the read-only buffer protocol or doesn't provide
- exactly one buffer segment, or it raises ValueError if offset is
- less than zero. The buffer will hold a reference to the base object, and
- the buffer's contents will refer to the base object's buffer interface,
- starting as position offset and extending for size bytes. If size is
- Py_END_OF_BUFFER, then the new buffer's contents extend to the
- length of the base object's exported buffer data.
-
- This function used an int type for offset and size. This
- might require changes in your code for properly supporting 64-bit
- systems."""
- raise NotImplementedError
-
- at cpython_api([PyObject, Py_ssize_t, Py_ssize_t], PyObject)
-def PyBuffer_FromReadWriteObject(space, base, offset, size):
- """Return a new writable buffer object. Parameters and exceptions are similar
- to those for PyBuffer_FromObject(). If the base object does not
- export the writeable buffer protocol, then TypeError is raised.
-
- This function used an int type for offset and size. This
- might require changes in your code for properly supporting 64-bit
- systems."""
- raise NotImplementedError
-
- at cpython_api([rffi.VOIDP_real, Py_ssize_t], PyObject)
-def PyBuffer_FromMemory(space, ptr, size):
- """Return a new read-only buffer object that reads from a specified location
- in memory, with a specified size. The caller is responsible for ensuring
- that the memory buffer, passed in as ptr, is not deallocated while the
- returned buffer object exists. Raises ValueError if size is less
- than zero. Note that Py_END_OF_BUFFER may not be passed for the
- size parameter; ValueError will be raised in that case.
-
- This function used an int type for size. This might require
- changes in your code for properly supporting 64-bit systems."""
- raise NotImplementedError
-
- at cpython_api([rffi.VOIDP_real, Py_ssize_t], PyObject)
-def PyBuffer_FromReadWriteMemory(space, ptr, size):
- """Similar to PyBuffer_FromMemory(), but the returned buffer is
- writable.
-
- This function used an int type for size. This might require
- changes in your code for properly supporting 64-bit systems."""
- raise NotImplementedError
-
- at cpython_api([Py_ssize_t], PyObject)
-def PyBuffer_New(space, size):
- """Return a new writable buffer object that maintains its own memory buffer of
- size bytes. ValueError is returned if size is not zero or
- positive. Note that the memory buffer (as returned by
- PyObject_AsWriteBuffer()) is not specifically aligned.
-
- This function used an int type for size. This might require
- changes in your code for properly supporting 64-bit systems."""
- raise NotImplementedError
-
- at 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
subtype of the bytearray type."""
@@ -763,19 +456,6 @@
number object."""
raise NotImplementedError
- at cpython_api([rffi.CCHARP, rffi.SIZE_T, rffi.CCHARP, ], rffi.INT_real, error=CANNOT_FAIL)
-def PyOS_snprintf(space, str, size, format, ):
- """Output not more than size bytes to str according to the format string
- format and the extra arguments. See the Unix man page snprintf(2)."""
- raise NotImplementedError
-
- at cpython_api([rffi.CCHARP, rffi.SIZE_T, rffi.CCHARP, va_list], rffi.INT_real, error=CANNOT_FAIL)
-def PyOS_vsnprintf(space, str, size, format, va):
- """Output not more than size bytes to str according to the format string
- format and the variable argument list va. Unix man page
- vsnprintf(2)."""
- raise NotImplementedError
-
@cpython_api([rffi.CCHARP, rffi.CCHARPP, PyObject], rffi.DOUBLE, error=-1.0)
def PyOS_string_to_double(space, s, endptr, overflow_exception):
"""Convert a string s to a double, raising a Python
@@ -1203,154 +883,6 @@
The delayed normalization is implemented to improve performance."""
raise NotImplementedError
- at cpython_api([PyObject, rffi.CCHARP, ], PyObject)
-def PyErr_Format(space, exception, format, ):
- """This function sets the error indicator and returns NULL. exception should be
- a Python exception (class, not an instance). format should be a string,
- containing format codes, similar to printf(). The width.precision
- before a format code is parsed, but the width part is ignored.
-
- % This should be exactly the same as the table in PyString_FromFormat.
-
- % One should just refer to the other.
-
- % The descriptions for %zd and %zu are wrong, but the truth is complicated
-
- % because not all compilers support the %z width modifier -- we fake it
-
- % when necessary via interpolating PY_FORMAT_SIZE_T.
-
- % Similar comments apply to the %ll width modifier and
-
- % PY_FORMAT_LONG_LONG.
-
- % %u, %lu, %zu should have "new in Python 2.5" blurbs.
-
-
-
-
-
-
-
- Format Characters
-
- Type
-
- Comment
-
- %%
-
- n/a
-
- The literal % character.
-
- %c
-
- int
-
- A single character,
- represented as an C int.
-
- %d
-
- int
-
- Exactly equivalent to
- printf("%d").
-
- %u
-
- unsigned int
-
- Exactly equivalent to
- printf("%u").
-
- %ld
-
- long
-
- Exactly equivalent to
- printf("%ld").
-
- %lu
-
- unsigned long
-
- Exactly equivalent to
- printf("%lu").
-
- %lld
-
- long long
-
- Exactly equivalent to
- printf("%lld").
-
- %llu
-
- unsigned
- long long
-
- Exactly equivalent to
- printf("%llu").
-
- %zd
-
- Py_ssize_t
-
- Exactly equivalent to
- printf("%zd").
-
- %zu
-
- size_t
-
- Exactly equivalent to
- printf("%zu").
-
- %i
-
- int
-
- Exactly equivalent to
- printf("%i").
-
- %x
-
- int
-
- Exactly equivalent to
- printf("%x").
-
- %s
-
- char*
-
- A null-terminated C character
- array.
-
- %p
-
- void*
-
- The hex representation of a C
- pointer. Mostly equivalent to
- printf("%p") except that
- it is guaranteed to start with
- the literal 0x regardless
- of what the platform's
- printf yields.
-
- An unrecognized format character causes all the rest of the format string to be
- copied as-is to the result string, and any extra arguments discarded.
-
- The "%lld" and "%llu" format specifiers are only available
- when HAVE_LONG_LONG is defined.
-
- Support for "%lld" and "%llu" added.
- Return value: always NULL."""
- raise NotImplementedError
-
@cpython_api([PyObject, rffi.CCHARP], PyObject)
def PyErr_SetFromErrnoWithFilename(space, type, filename):
"""Similar to PyErr_SetFromErrno(), with the additional behavior that if
@@ -2844,30 +2376,6 @@
raise SystemError and return NULL."""
raise NotImplementedError
- at cpython_api([PyObject, rffi.CCHARP, PyObject], rffi.INT_real, error=-1)
-def PyModule_AddObject(space, module, name, value):
- """Add an object to module as name. This is a convenience function which can
- be used from the module's initialization function. This steals a reference to
- value. Return -1 on error, 0 on success.
- """
- raise NotImplementedError
-
- at cpython_api([PyObject, rffi.CCHARP, lltype.Signed], rffi.INT_real, error=-1)
-def PyModule_AddIntConstant(space, module, name, value):
- """Add an integer constant to module as name. This convenience function can be
- used from the module's initialization function. Return -1 on error, 0 on
- success.
- """
- raise NotImplementedError
-
- at cpython_api([PyObject, rffi.CCHARP, rffi.CCHARP], rffi.INT_real, error=-1)
-def PyModule_AddStringConstant(space, module, name, value):
- """Add a string constant to module as name. This convenience function can be
- used from the module's initialization function. The string value must be
- null-terminated. Return -1 on error, 0 on success.
- """
- raise NotImplementedError
-
@cpython_api([PyObjectP, PyObjectP], rffi.INT_real, error=-1)
def PyNumber_Coerce(space, p1, p2):
"""
@@ -2919,40 +2427,6 @@
require changes in your code for properly supporting 64-bit systems."""
raise NotImplementedError
- at cpython_api([PyObject, rffi.VOIDPP, Py_ssize_t], rffi.INT_real, error=-1)
-def PyObject_AsReadBuffer(space, obj, buffer, buffer_len):
- """Returns a pointer to a read-only memory location containing arbitrary data.
- The obj argument must support the single-segment readable buffer
- interface. On success, returns 0, sets buffer to the memory location
- and buffer_len to the buffer length. Returns -1 and sets a
- TypeError on error.
-
-
-
- This function used an int * type for buffer_len. This might
- require changes in your code for properly supporting 64-bit systems."""
- raise NotImplementedError
-
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
-def PyObject_CheckReadBuffer(space, o):
- """Returns 1 if o supports the single-segment readable buffer interface.
- Otherwise returns 0.
- """
- raise NotImplementedError
-
- at cpython_api([PyObject, rffi.VOIDPP, Py_ssize_t], rffi.INT_real, error=-1)
-def PyObject_AsWriteBuffer(space, obj, buffer, buffer_len):
- """Returns a pointer to a writeable memory location. The obj argument must
- support the single-segment, character buffer interface. On success,
- returns 0, sets buffer to the memory location and buffer_len to the
- buffer length. Returns -1 and sets a TypeError on error.
-
-
-
- This function used an int * type for buffer_len. This might
- require changes in your code for properly supporting 64-bit systems."""
- raise NotImplementedError
-
@cpython_api([PyObject, rffi.CCHARP], rffi.INT_real, error=-1)
def PyObject_DelAttrString(space, o, attr_name):
"""Delete attribute named attr_name, for object o. Returns -1 on failure.
@@ -2978,51 +2452,6 @@
for PyObject_Str()."""
raise NotImplementedError
- at cpython_api([PyObject, rffi.CCHARP, ], PyObject)
-def PyObject_CallFunction(space, callable, format, ):
- """
-
-
-
- Call a callable Python object callable, with a variable number of C arguments.
- The C arguments are described using a Py_BuildValue() style format
- string. The format may be NULL, indicating that no arguments are provided.
- Returns the result of the call on success, or NULL on failure. This is the
- equivalent of the Python expression apply(callable, args) or
- callable(*args). Note that if you only pass PyObject * args,
- PyObject_CallFunctionObjArgs() is a faster alternative."""
- raise NotImplementedError
-
- at cpython_api([PyObject, rffi.CCHARP, rffi.CCHARP, ], PyObject)
-def PyObject_CallMethod(space, o, method, format, ):
- """Call the method named method of object o with a variable number of C
- arguments. The C arguments are described by a Py_BuildValue() format
- string that should produce a tuple. The format may be NULL, indicating that
- no arguments are provided. Returns the result of the call on success, or NULL
- on failure. This is the equivalent of the Python expression o.method(args).
- Note that if you only pass PyObject * args,
- PyObject_CallMethodObjArgs() is a faster alternative."""
- raise NotImplementedError
-
- at cpython_api([PyObject, ], PyObject)
-def PyObject_CallFunctionObjArgs(space, callable, ):
- """Call a callable Python object callable, with a variable number of
- PyObject* arguments. The arguments are provided as a variable number
- of parameters followed by NULL. Returns the result of the call on success, or
- NULL on failure.
- """
- raise NotImplementedError
-
- at cpython_api([PyObject, PyObject, ], PyObject)
-def PyObject_CallMethodObjArgs(space, o, name, ):
- """Calls a method of the object o, where the name of the method is given as a
- Python string object in name. It is called with a variable number of
- PyObject* arguments. The arguments are provided as a variable number
- of parameters followed by NULL. Returns the result of the call on success, or
- NULL on failure.
- """
- raise NotImplementedError
-
@cpython_api([PyObject], lltype.Signed, error=-1)
def PyObject_HashNotImplemented(space, o):
"""Set a TypeError indicating that type(o) is not hashable and return -1.
@@ -3367,160 +2796,6 @@
changes in your code for properly supporting 64-bit systems."""
raise NotImplementedError
- at cpython_api([rffi.CCHARP, ], PyObject)
-def PyString_FromFormat(space, format, ):
- """Take a C printf()-style format string and a variable number of
- arguments, calculate the size of the resulting Python string and return a string
- with the values formatted into it. The variable arguments must be C types and
- must correspond exactly to the format characters in the format string. The
- following format characters are allowed:
-
- % This should be exactly the same as the table in PyErr_Format.
-
- % One should just refer to the other.
-
- % The descriptions for %zd and %zu are wrong, but the truth is complicated
-
- % because not all compilers support the %z width modifier -- we fake it
-
- % when necessary via interpolating PY_FORMAT_SIZE_T.
-
- % Similar comments apply to the %ll width modifier and
-
- % PY_FORMAT_LONG_LONG.
-
- % %u, %lu, %zu should have "new in Python 2.5" blurbs.
-
-
-
-
-
-
-
- Format Characters
-
- Type
-
- Comment
-
- %%
-
- n/a
-
- The literal % character.
-
- %c
-
- int
-
- A single character,
- represented as an C int.
-
- %d
-
- int
-
- Exactly equivalent to
- printf("%d").
-
- %u
-
- unsigned int
-
- Exactly equivalent to
- printf("%u").
-
- %ld
-
- long
-
- Exactly equivalent to
- printf("%ld").
-
- %lu
-
- unsigned long
-
- Exactly equivalent to
- printf("%lu").
-
- %lld
-
- long long
-
- Exactly equivalent to
- printf("%lld").
-
- %llu
-
- unsigned
- long long
-
- Exactly equivalent to
- printf("%llu").
-
- %zd
-
- Py_ssize_t
-
- Exactly equivalent to
- printf("%zd").
-
- %zu
-
- size_t
-
- Exactly equivalent to
- printf("%zu").
-
- %i
-
- int
-
- Exactly equivalent to
- printf("%i").
-
- %x
-
- int
-
- Exactly equivalent to
- printf("%x").
-
- %s
-
- char*
-
- A null-terminated C character
- array.
-
- %p
-
- void*
-
- The hex representation of a C
- pointer. Mostly equivalent to
- printf("%p") except that
- it is guaranteed to start with
- the literal 0x regardless
- of what the platform's
- printf yields.
-
- An unrecognized format character causes all the rest of the format string to be
- copied as-is to the result string, and any extra arguments discarded.
-
- The "%lld" and "%llu" format specifiers are only available
- when HAVE_LONG_LONG is defined.
-
- Support for "%lld" and "%llu" added."""
- raise NotImplementedError
-
- at cpython_api([rffi.CCHARP, va_list], PyObject)
-def PyString_FromFormatV(space, format, vargs):
- """Identical to PyString_FromFormat() except that it takes exactly two
- arguments."""
- raise NotImplementedError
-
@cpython_api([PyObject], Py_ssize_t)
def PyString_GET_SIZE(space, string):
"""Macro form of PyString_Size() but without error checking.
@@ -3698,20 +2973,6 @@
"""As above, but write to sys.stderr or stderr instead."""
raise NotImplementedError
- at cpython_api([rffi.CCHARP], lltype.Void)
-def Py_FatalError(space, message):
- """
-
-
-
- Print a fatal error message and kill the process. No cleanup is performed.
- This function should only be invoked when a condition is detected that would
- make it dangerous to continue using the Python interpreter; e.g., when the
- object administration appears to be corrupted. On Unix, the standard C library
- function abort() is called which will attempt to produce a core
- file."""
- raise NotImplementedError
-
@cpython_api([rffi.INT_real], lltype.Void)
def Py_Exit(space, status):
"""
@@ -3737,18 +2998,6 @@
the cleanup function, no Python APIs should be called by func."""
raise NotImplementedError
- at cpython_api([Py_ssize_t, ], PyObject)
-def PyTuple_Pack(space, n, ):
- """Return a new tuple object of size n, or NULL on failure. The tuple values
- are initialized to the subsequent n C arguments pointing to Python objects.
- PyTuple_Pack(2, a, b) is equivalent to Py_BuildValue("(OO)", a, b).
-
-
-
- This function used an int type for n. This might require
- changes in your code for properly supporting 64-bit systems."""
- raise NotImplementedError
-
@cpython_api([PyObject, Py_ssize_t], PyObject, borrowed=True)
def PyTuple_GET_ITEM(space, p, pos):
"""Like PyTuple_GetItem(), but does no checking of its arguments.
More information about the Pypy-commit
mailing list