[pypy-svn] pypy real-rffi.INT: module/cpyext: s/INT_real/INT/g
amauryfa
commits-noreply at bitbucket.org
Wed Mar 2 13:55:23 CET 2011
Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: real-rffi.INT
Changeset: r42382:2a1fa9b997c0
Date: 2011-03-02 13:27 +0100
http://bitbucket.org/pypy/pypy/changeset/2a1fa9b997c0/
Log: module/cpyext: s/INT_real/INT/g
diff --git a/pypy/module/cpyext/stubsactive.py b/pypy/module/cpyext/stubsactive.py
--- a/pypy/module/cpyext/stubsactive.py
+++ b/pypy/module/cpyext/stubsactive.py
@@ -58,7 +58,7 @@
compile time."""
raise NotImplementedError
- at cpython_api([], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([], rffi.INT, error=CANNOT_FAIL)
def Py_MakePendingCalls(space):
return 0
diff --git a/pypy/module/cpyext/sequence.py b/pypy/module/cpyext/sequence.py
--- a/pypy/module/cpyext/sequence.py
+++ b/pypy/module/cpyext/sequence.py
@@ -18,7 +18,7 @@
"""
return space.mul(w_obj, space.wrap(count))
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PySequence_Check(space, w_obj):
"""Return 1 if the object provides sequence protocol, and 0 otherwise.
This function always succeeds."""
@@ -81,14 +81,14 @@
failure. This is the equivalent of the Python expression o[i1:i2]."""
return space.getslice(w_obj, space.wrap(start), space.wrap(end))
- at cpython_api([PyObject, Py_ssize_t, Py_ssize_t, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, Py_ssize_t, Py_ssize_t, PyObject], rffi.INT, error=-1)
def PySequence_SetSlice(space, w_obj, start, end, w_value):
"""Assign the sequence object v to the slice in sequence object o from i1 to
i2. This is the equivalent of the Python statement o[i1:i2] = v."""
space.setslice(w_obj, space.wrap(start), space.wrap(end), w_value)
return 0
- at cpython_api([PyObject, Py_ssize_t, Py_ssize_t], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, Py_ssize_t, Py_ssize_t], rffi.INT, error=-1)
def PySequence_DelSlice(space, w_obj, start, end):
"""Delete the slice in sequence object o from i1 to i2. Returns -1 on
failure. This is the equivalent of the Python statement del o[i1:i2]."""
@@ -121,7 +121,7 @@
This is the equivalent of the Python expression o1 + o2."""
return space.add(w_o1, w_o2)
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PySequence_Contains(space, w_obj, w_value):
"""Determine if o contains value. If an item in o is equal to value,
return 1, otherwise return 0. On error, return -1. This is
@@ -137,7 +137,7 @@
"""
return space.iter(w_seq)
- at cpython_api([PyObject, Py_ssize_t, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, Py_ssize_t, PyObject], rffi.INT, error=-1)
def PySequence_SetItem(space, w_o, i, w_v):
"""Assign object v to the ith element of o. Returns -1 on failure. This
is the equivalent of the Python statement o[i] = v. This function does
@@ -148,7 +148,7 @@
space.setitem(w_o, space.wrap(i), w_v)
return 0
- at cpython_api([PyObject, Py_ssize_t], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, Py_ssize_t], rffi.INT, error=-1)
def PySequence_DelItem(space, w_o, i):
"""Delete the ith element of object o. Returns -1 on failure. This is the
equivalent of the Python statement del o[i]."""
diff --git a/pypy/module/cpyext/api.py b/pypy/module/cpyext/api.py
--- a/pypy/module/cpyext/api.py
+++ b/pypy/module/cpyext/api.py
@@ -466,9 +466,9 @@
w_type = get_w_type(space)
return space.is_w(w_obj_type, w_type)
- check = cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)(
+ check = cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)(
func_with_new_name(check, check_name))
- check_exact = cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)(
+ check_exact = cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)(
func_with_new_name(check_exact, check_name + "Exact"))
return check, check_exact
diff --git a/pypy/module/cpyext/pyerrors.py b/pypy/module/cpyext/pyerrors.py
--- a/pypy/module/cpyext/pyerrors.py
+++ b/pypy/module/cpyext/pyerrors.py
@@ -154,7 +154,7 @@
space.wrap(msg))
raise OperationError(w_type, w_error)
- at cpython_api([], rffi.INT_real, error=-1)
+ at cpython_api([], rffi.INT, error=-1)
def PyErr_CheckSignals(space):
"""
This function interacts with Python's signal handling. It checks whether a
@@ -168,7 +168,7 @@
# XXX implement me
return 0
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=CANNOT_FAIL)
def PyErr_GivenExceptionMatches(space, w_given, w_exc):
"""Return true if the given exception matches the exception in exc. If
exc is a class object, this also returns true when given is an instance
@@ -181,7 +181,7 @@
w_given_type = w_given
return space.exception_match(w_given_type, w_exc)
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyErr_ExceptionMatches(space, w_exc):
"""Equivalent to PyErr_GivenExceptionMatches(PyErr_Occurred(), exc). This
should only be called when an exception is actually set; a memory access
@@ -190,7 +190,7 @@
return PyErr_GivenExceptionMatches(space, w_type, w_exc)
- at cpython_api([PyObject, CONST_STRING, rffi.INT_real], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, CONST_STRING, rffi.INT], rffi.INT, error=-1)
def PyErr_WarnEx(space, w_category, message_ptr, stacklevel):
"""Issue a warning message. The category argument is a warning category (see
below) or NULL; the message argument is a message string. stacklevel is a
@@ -235,7 +235,7 @@
space.call_function(w_warn, w_message, w_category, w_stacklevel)
return 0
- at cpython_api([PyObject, CONST_STRING], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, CONST_STRING], rffi.INT, error=-1)
def PyErr_Warn(space, w_category, message):
"""Issue a warning message. The category argument is a warning category (see
below) or NULL; the message argument is a message string. The warning will
@@ -245,7 +245,7 @@
Deprecated; use PyErr_WarnEx() instead."""
return PyErr_WarnEx(space, w_category, message, 1)
- at cpython_api([rffi.INT_real], lltype.Void)
+ at cpython_api([rffi.INT], lltype.Void)
def PyErr_PrintEx(space, set_sys_last_vars):
"""Print a standard traceback to sys.stderr and clear the error indicator.
Call this function only when the error indicator is set. (Otherwise it will
@@ -276,7 +276,7 @@
"""Alias for PyErr_PrintEx(1)."""
PyErr_PrintEx(space, 1)
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PyTraceBack_Print(space, w_tb, w_file):
space.call_method(w_file, "write", space.wrap(
'Traceback (most recent call last):\n'))
diff --git a/pypy/module/cpyext/typeobject.py b/pypy/module/cpyext/typeobject.py
--- a/pypy/module/cpyext/typeobject.py
+++ b/pypy/module/cpyext/typeobject.py
@@ -465,7 +465,7 @@
pto.c_tp_flags |= Py_TPFLAGS_READY
return pto
- at cpython_api([PyTypeObjectPtr], rffi.INT_real, error=-1)
+ at cpython_api([PyTypeObjectPtr], rffi.INT, error=-1)
def PyType_Ready(space, pto):
if pto.c_tp_flags & Py_TPFLAGS_READY:
return 0
@@ -602,7 +602,7 @@
w_dict = space.newdict(from_strdict_shared=w_obj.dict_w)
pto.c_tp_dict = make_ref(space, w_dict)
- at cpython_api([PyTypeObjectPtr, PyTypeObjectPtr], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyTypeObjectPtr, PyTypeObjectPtr], rffi.INT, error=CANNOT_FAIL)
def PyType_IsSubtype(space, a, b):
"""Return true if a is a subtype of b.
"""
diff --git a/pypy/module/cpyext/object.py b/pypy/module/cpyext/object.py
--- a/pypy/module/cpyext/object.py
+++ b/pypy/module/cpyext/object.py
@@ -84,11 +84,11 @@
def _PyObject_GetDictPtr(space, op):
return lltype.nullptr(PyObjectP.TO)
- at cpython_api([PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject], rffi.INT, error=-1)
def PyObject_IsTrue(space, w_obj):
return space.is_true(w_obj)
- at cpython_api([PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject], rffi.INT, error=-1)
def PyObject_Not(space, w_obj):
return not space.is_true(w_obj)
@@ -107,7 +107,7 @@
name = rffi.charp2str(name_ptr)
return space.getattr(w_obj, space.wrap(name))
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=CANNOT_FAIL)
def PyObject_HasAttr(space, w_obj, w_name):
try:
w_res = operation.hasattr(space, w_obj, w_name)
@@ -115,7 +115,7 @@
except OperationError:
return 0
- at cpython_api([PyObject, CONST_STRING], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject, CONST_STRING], rffi.INT, error=CANNOT_FAIL)
def PyObject_HasAttrString(space, w_obj, name_ptr):
try:
name = rffi.charp2str(name_ptr)
@@ -124,25 +124,25 @@
except OperationError:
return 0
- at cpython_api([PyObject, PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject, PyObject], rffi.INT, error=-1)
def PyObject_SetAttr(space, w_obj, w_name, w_value):
operation.setattr(space, w_obj, w_name, w_value)
return 0
- at cpython_api([PyObject, CONST_STRING, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, CONST_STRING, PyObject], rffi.INT, error=-1)
def PyObject_SetAttrString(space, w_obj, name_ptr, w_value):
w_name = space.wrap(rffi.charp2str(name_ptr))
operation.setattr(space, w_obj, w_name, w_value)
return 0
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PyObject_DelAttr(space, w_obj, w_name):
"""Delete attribute named attr_name, for object o. Returns -1 on failure.
This is the equivalent of the Python statement del o.attr_name."""
space.delattr(w_obj, w_name)
return 0
- at cpython_api([PyObject, CONST_STRING], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, CONST_STRING], rffi.INT, error=-1)
def PyObject_DelAttrString(space, w_obj, name_ptr):
"""Delete attribute named attr_name, for object o. Returns -1 on failure.
This is the equivalent of the Python statement del o.attr_name."""
@@ -158,7 +158,7 @@
def PyObject_Size(space, w_obj):
return space.len_w(w_obj)
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyCallable_Check(space, w_obj):
"""Determine if the object o is callable. Return 1 if the object is callable
and 0 otherwise. This function always succeeds."""
@@ -170,14 +170,14 @@
This is the equivalent of the Python expression o[key]."""
return space.getitem(w_obj, w_key)
- at cpython_api([PyObject, PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject, PyObject], rffi.INT, error=-1)
def PyObject_SetItem(space, w_obj, w_key, w_value):
"""Map the object key to the value v. Returns -1 on failure. This is the
equivalent of the Python statement o[key] = v."""
space.setitem(w_obj, w_key, w_value)
return 0
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PyObject_DelItem(space, w_obj, w_key):
"""Delete the mapping for key from o. Returns -1 on failure. This is the
equivalent of the Python statement del o[key]."""
@@ -246,7 +246,7 @@
function."""
return space.call_function(space.w_unicode, w_obj)
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PyObject_Compare(space, w_o1, w_o2):
"""
Compare the values of o1 and o2 using a routine provided by o1, if one
@@ -256,7 +256,7 @@
expression cmp(o1, o2)."""
return space.int_w(space.cmp(w_o1, w_o2))
- at cpython_api([PyObject, PyObject, rffi.INT_real], PyObject)
+ at cpython_api([PyObject, PyObject, rffi.INT], PyObject)
def PyObject_RichCompare(space, w_o1, w_o2, opid_int):
"""Compare the values of o1 and o2 using the operation specified by opid,
which must be one of Py_LT, Py_LE, Py_EQ,
@@ -273,7 +273,7 @@
if opid == Py_GE: return space.ge(w_o1, w_o2)
PyErr_BadInternalCall(space)
- at cpython_api([PyObject, PyObject, rffi.INT_real], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject, rffi.INT], rffi.INT, error=-1)
def PyObject_RichCompareBool(space, ref1, ref2, opid):
"""Compare the values of o1 and o2 using the operation specified by opid,
which must be one of Py_LT, Py_LE, Py_EQ,
@@ -303,7 +303,7 @@
w_descr = object_getattribute(space)
return space.get_and_call_function(w_descr, w_obj, w_name)
- at cpython_api([PyObject, PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject, PyObject], rffi.INT, error=-1)
def PyObject_GenericSetAttr(space, w_obj, w_name, w_value):
"""Generic attribute setter function that is meant to be put into a type
object's tp_setattro slot. It looks for a data descriptor in the
@@ -320,7 +320,7 @@
space.get_and_call_function(w_descr, w_obj, w_name)
return 0
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PyObject_IsInstance(space, w_inst, w_cls):
"""Returns 1 if inst is an instance of the class cls or a subclass of
cls, or 0 if not. On error, returns -1 and sets an exception. If
@@ -335,7 +335,7 @@
from pypy.module.__builtin__.abstractinst import abstract_isinstance_w
return abstract_isinstance_w(space, w_inst, w_cls)
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PyObject_IsSubclass(space, w_derived, w_cls):
"""Returns 1 if the class derived is identical to or derived from the class
cls, otherwise returns 0. In case of an error, returns -1. If cls
@@ -346,7 +346,7 @@
from pypy.module.__builtin__.abstractinst import abstract_issubclass_w
return abstract_issubclass_w(space, w_derived, w_cls)
- at cpython_api([PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject], rffi.INT, error=-1)
def PyObject_AsFileDescriptor(space, w_obj):
"""Derives a file descriptor from a Python object. If the object is an
integer or long integer, its value is returned. If not, the object's
@@ -371,7 +371,7 @@
space.w_ValueError, space.wrap(
"file descriptor cannot be a negative integer"))
- return rffi.cast(rffi.INT_real, fd)
+ return rffi.cast(rffi.INT, fd)
@cpython_api([PyObject], lltype.Signed, error=-1)
@@ -381,7 +381,7 @@
This is the equivalent of the Python expression hash(o)."""
return space.int_w(space.hash(w_obj))
- at cpython_api([PyObject, rffi.CCHARPP, Py_ssize_tP], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, rffi.CCHARPP, Py_ssize_tP], rffi.INT, error=-1)
def PyObject_AsCharBuffer(space, obj, bufferp, sizep):
"""Returns a pointer to a read-only memory location usable as
character-based input. The obj argument must support the single-segment
@@ -409,7 +409,7 @@
# Also in include/object.h
Py_PRINT_RAW = 1 # No string quotes etc.
- at cpython_api([PyObject, FILEP, rffi.INT_real], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, FILEP, rffi.INT], rffi.INT, error=-1)
def PyObject_Print(space, w_obj, fp, flags):
"""Print an object o, on file fp. Returns -1 on error. The flags argument
is used to enable certain printing options. The only option currently
@@ -431,7 +431,7 @@
PyFile_Check, PyFile_CheckExact = build_type_checkers("File", W_File)
- at cpython_api([PyObject, rffi.INT_real], PyObject)
+ at cpython_api([PyObject, rffi.INT], PyObject)
def PyFile_GetLine(space, w_obj, n):
"""
Equivalent to p.readline([n]), this function reads one line from the
diff --git a/pypy/module/cpyext/intobject.py b/pypy/module/cpyext/intobject.py
--- a/pypy/module/cpyext/intobject.py
+++ b/pypy/module/cpyext/intobject.py
@@ -74,7 +74,7 @@
"""
return space.wrap(ival) # XXX this is wrong on win64
- at cpython_api([CONST_STRING, rffi.CCHARPP, rffi.INT_real], PyObject)
+ at cpython_api([CONST_STRING, rffi.CCHARPP, rffi.INT], PyObject)
def PyInt_FromString(space, str, pend, base):
"""Return a new PyIntObject or PyLongObject based on the string
value in str, which is interpreted according to the radix in base. If
diff --git a/pypy/module/cpyext/dictobject.py b/pypy/module/cpyext/dictobject.py
--- a/pypy/module/cpyext/dictobject.py
+++ b/pypy/module/cpyext/dictobject.py
@@ -21,7 +21,7 @@
return None
return borrow_from(w_dict, w_res)
- at cpython_api([PyObject, PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject, PyObject], rffi.INT, error=-1)
def PyDict_SetItem(space, w_dict, w_key, w_obj):
if PyDict_Check(space, w_dict):
space.setitem(w_dict, w_key, w_obj)
@@ -29,7 +29,7 @@
else:
PyErr_BadInternalCall(space)
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PyDict_DelItem(space, w_dict, w_key):
if PyDict_Check(space, w_dict):
space.delitem(w_dict, w_key)
@@ -37,7 +37,7 @@
else:
PyErr_BadInternalCall(space)
- at cpython_api([PyObject, CONST_STRING, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, CONST_STRING, PyObject], rffi.INT, error=-1)
def PyDict_SetItemString(space, w_dict, key_ptr, w_obj):
if PyDict_Check(space, w_dict):
key = rffi.charp2str(key_ptr)
@@ -60,7 +60,7 @@
return None
return borrow_from(w_dict, w_res)
- at cpython_api([PyObject, rffi.CCHARP], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, rffi.CCHARP], rffi.INT, error=-1)
def PyDict_DelItemString(space, w_dict, key_ptr):
"""Remove the entry in dictionary p which has a key specified by the string
key. Return 0 on success or -1 on failure."""
@@ -80,7 +80,7 @@
len(p) on a dictionary."""
return space.len_w(w_obj)
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PyDict_Contains(space, w_obj, w_value):
"""Determine if dictionary p contains key. If an item in p is matches
key, return 1, otherwise return 0. On error, return -1.
@@ -100,7 +100,7 @@
"""
return space.call_method(w_obj, "copy")
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PyDict_Update(space, w_obj, w_other):
"""This is the same as PyDict_Merge(a, b, 1) in C, or a.update(b) in
Python. Return 0 on success or -1 if an exception was raised.
@@ -126,7 +126,7 @@
dictionary, as in the dictionary method dict.items()."""
return space.call_method(w_obj, "items")
- at cpython_api([PyObject, Py_ssize_tP, PyObjectP, PyObjectP], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject, Py_ssize_tP, PyObjectP, PyObjectP], rffi.INT, error=CANNOT_FAIL)
def PyDict_Next(space, w_dict, ppos, pkey, pvalue):
"""Iterate over all key-value pairs in the dictionary p. The
Py_ssize_t referred to by ppos must be initialized to 0
diff --git a/pypy/module/cpyext/methodobject.py b/pypy/module/cpyext/methodobject.py
--- a/pypy/module/cpyext/methodobject.py
+++ b/pypy/module/cpyext/methodobject.py
@@ -24,7 +24,7 @@
'PyMethodDef',
[('ml_name', rffi.CCHARP),
('ml_meth', PyCFunction_typedef),
- ('ml_flags', rffi.INT_real),
+ ('ml_flags', rffi.INT),
('ml_doc', rffi.CCHARP),
])
diff --git a/pypy/module/cpyext/typeobjectdefs.py b/pypy/module/cpyext/typeobjectdefs.py
--- a/pypy/module/cpyext/typeobjectdefs.py
+++ b/pypy/module/cpyext/typeobjectdefs.py
@@ -13,44 +13,44 @@
freefunc = P(FT([rffi.VOIDP], Void))
destructor = P(FT([PyO], Void))
-printfunc = P(FT([PyO, FILEP, rffi.INT_real], rffi.INT))
+printfunc = P(FT([PyO, FILEP, rffi.INT], rffi.INT))
getattrfunc = P(FT([PyO, rffi.CCHARP], PyO))
getattrofunc = P(FT([PyO, PyO], PyO))
-setattrfunc = P(FT([PyO, rffi.CCHARP, PyO], rffi.INT_real))
-setattrofunc = P(FT([PyO, PyO, PyO], rffi.INT_real))
-cmpfunc = P(FT([PyO, PyO], rffi.INT_real))
+setattrfunc = P(FT([PyO, rffi.CCHARP, PyO], rffi.INT))
+setattrofunc = P(FT([PyO, PyO, PyO], rffi.INT))
+cmpfunc = P(FT([PyO, PyO], rffi.INT))
reprfunc = P(FT([PyO], PyO))
hashfunc = P(FT([PyO], lltype.Signed))
-richcmpfunc = P(FT([PyO, PyO, rffi.INT_real], PyO))
+richcmpfunc = P(FT([PyO, PyO, rffi.INT], PyO))
getiterfunc = P(FT([PyO], PyO))
iternextfunc = P(FT([PyO], PyO))
descrgetfunc = P(FT([PyO, PyO, PyO], PyO))
-descrsetfunc = P(FT([PyO, PyO, PyO], rffi.INT_real))
-initproc = P(FT([PyO, PyO, PyO], rffi.INT_real))
+descrsetfunc = P(FT([PyO, PyO, PyO], rffi.INT))
+initproc = P(FT([PyO, PyO, PyO], rffi.INT))
newfunc = P(FT([PyTypeObjectPtr, PyO, PyO], PyO))
allocfunc = P(FT([PyTypeObjectPtr, Py_ssize_t], PyO))
unaryfunc = P(FT([PyO], PyO))
binaryfunc = P(FT([PyO, PyO], PyO))
ternaryfunc = P(FT([PyO, PyO, PyO], PyO))
-inquiry = P(FT([PyO], rffi.INT_real))
+inquiry = P(FT([PyO], rffi.INT))
lenfunc = P(FT([PyO], Py_ssize_t))
-coercion = P(FT([PyOPtr, PyOPtr], rffi.INT_real))
-intargfunc = P(FT([PyO, rffi.INT_real], PyO))
-intintargfunc = P(FT([PyO, rffi.INT_real, rffi.INT], PyO))
+coercion = P(FT([PyOPtr, PyOPtr], rffi.INT))
+intargfunc = P(FT([PyO, rffi.INT], PyO))
+intintargfunc = P(FT([PyO, rffi.INT, rffi.INT], PyO))
ssizeargfunc = P(FT([PyO, Py_ssize_t], PyO))
ssizessizeargfunc = P(FT([PyO, Py_ssize_t, Py_ssize_t], PyO))
-intobjargproc = P(FT([PyO, rffi.INT_real, PyO], rffi.INT))
-intintobjargproc = P(FT([PyO, rffi.INT_real, rffi.INT, PyO], rffi.INT))
-ssizeobjargproc = P(FT([PyO, Py_ssize_t, PyO], rffi.INT_real))
-ssizessizeobjargproc = P(FT([PyO, Py_ssize_t, Py_ssize_t, PyO], rffi.INT_real))
-objobjargproc = P(FT([PyO, PyO, PyO], rffi.INT_real))
+intobjargproc = P(FT([PyO, rffi.INT, PyO], rffi.INT))
+intintobjargproc = P(FT([PyO, rffi.INT, rffi.INT, PyO], rffi.INT))
+ssizeobjargproc = P(FT([PyO, Py_ssize_t, PyO], rffi.INT))
+ssizessizeobjargproc = P(FT([PyO, Py_ssize_t, Py_ssize_t, PyO], rffi.INT))
+objobjargproc = P(FT([PyO, PyO, PyO], rffi.INT))
-objobjproc = P(FT([PyO, PyO], rffi.INT_real))
-visitproc = P(FT([PyO, rffi.VOIDP], rffi.INT_real))
-traverseproc = P(FT([PyO, visitproc, rffi.VOIDP], rffi.INT_real))
+objobjproc = P(FT([PyO, PyO], rffi.INT))
+visitproc = P(FT([PyO, rffi.VOIDP], rffi.INT))
+traverseproc = P(FT([PyO, visitproc, rffi.VOIDP], rffi.INT))
getter = P(FT([PyO, rffi.VOIDP], PyO))
-setter = P(FT([PyO, PyO, rffi.VOIDP], rffi.INT_real))
+setter = P(FT([PyO, PyO, rffi.VOIDP], rffi.INT))
wrapperfunc = P(FT([PyO, PyO, rffi.VOIDP], PyO))
wrapperfunc_kwds = P(FT([PyO, PyO, rffi.VOIDP, PyO], PyO))
@@ -140,9 +140,9 @@
PyMemberDef = cpython_struct("PyMemberDef", (
("name", rffi.CCHARP),
- ("type", rffi.INT_real),
+ ("type", rffi.INT),
("offset", Py_ssize_t),
- ("flags", rffi.INT_real),
+ ("flags", rffi.INT),
("doc", rffi.CCHARP),
))
diff --git a/pypy/module/cpyext/tupleobject.py b/pypy/module/cpyext/tupleobject.py
--- a/pypy/module/cpyext/tupleobject.py
+++ b/pypy/module/cpyext/tupleobject.py
@@ -14,7 +14,7 @@
def PyTuple_New(space, size):
return space.newtuple([space.w_None] * size)
- at cpython_api([PyObject, Py_ssize_t, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, Py_ssize_t, PyObject], rffi.INT, error=-1)
def PyTuple_SetItem(space, w_t, pos, w_obj):
if not PyTuple_Check(space, w_t):
# XXX this should also steal a reference, test it!!!
@@ -48,7 +48,7 @@
return PyTuple_GET_SIZE(space, ref)
- at cpython_api([PyObjectP, Py_ssize_t], rffi.INT_real, error=-1)
+ at cpython_api([PyObjectP, Py_ssize_t], rffi.INT, error=-1)
def _PyTuple_Resize(space, ref, newsize):
"""Can be used to resize a tuple. newsize will be the new length of the tuple.
Because tuples are supposed to be immutable, this should only be used if there
diff --git a/pypy/module/cpyext/test/test_longobject.py b/pypy/module/cpyext/test/test_longobject.py
--- a/pypy/module/cpyext/test/test_longobject.py
+++ b/pypy/module/cpyext/test/test_longobject.py
@@ -68,7 +68,7 @@
space.wrap(1<<64)) == 0
def test_as_long_and_overflow(self, space, api):
- overflow = lltype.malloc(rffi.CArrayPtr(rffi.INT_real).TO, 1, flavor='raw')
+ overflow = lltype.malloc(rffi.CArrayPtr(rffi.INT).TO, 1, flavor='raw')
assert api.PyLong_AsLongAndOverflow(
space.wrap(sys.maxint), overflow) == sys.maxint
assert api.PyLong_AsLongAndOverflow(
@@ -78,7 +78,7 @@
lltype.free(overflow, flavor='raw')
def test_as_longlong_and_overflow(self, space, api):
- overflow = lltype.malloc(rffi.CArrayPtr(rffi.INT_real).TO, 1, flavor='raw')
+ overflow = lltype.malloc(rffi.CArrayPtr(rffi.INT).TO, 1, flavor='raw')
assert api.PyLong_AsLongLongAndOverflow(
space.wrap(1<<62), overflow) == 1<<62
assert api.PyLong_AsLongLongAndOverflow(
diff --git a/pypy/module/cpyext/longobject.py b/pypy/module/cpyext/longobject.py
--- a/pypy/module/cpyext/longobject.py
+++ b/pypy/module/cpyext/longobject.py
@@ -79,7 +79,7 @@
num = space.bigint_w(w_long)
return num.ulonglongmask()
- at cpython_api([PyObject, rffi.CArrayPtr(rffi.INT_real)], lltype.Signed,
+ at cpython_api([PyObject, rffi.CArrayPtr(rffi.INT)], lltype.Signed,
error=-1)
def PyLong_AsLongAndOverflow(space, w_long, overflow_ptr):
"""
@@ -88,19 +88,19 @@
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."""
- overflow_ptr[0] = rffi.cast(rffi.INT_real, 0)
+ overflow_ptr[0] = rffi.cast(rffi.INT, 0)
try:
return space.int_w(w_long)
except OperationError, e:
if not e.match(space, space.w_OverflowError):
raise
if space.is_true(space.gt(w_long, space.wrap(0))):
- overflow_ptr[0] = rffi.cast(rffi.INT_real, 1)
+ overflow_ptr[0] = rffi.cast(rffi.INT, 1)
else:
- overflow_ptr[0] = rffi.cast(rffi.INT_real, -1)
+ overflow_ptr[0] = rffi.cast(rffi.INT, -1)
return -1
- at cpython_api([PyObject, rffi.CArrayPtr(rffi.INT_real)], rffi.LONGLONG,
+ at cpython_api([PyObject, rffi.CArrayPtr(rffi.INT)], rffi.LONGLONG,
error=-1)
def PyLong_AsLongLongAndOverflow(space, w_long, overflow_ptr):
"""
@@ -109,16 +109,16 @@
-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."""
- overflow_ptr[0] = rffi.cast(rffi.INT_real, 0)
+ overflow_ptr[0] = rffi.cast(rffi.INT, 0)
try:
return rffi.cast(rffi.LONGLONG, space.r_longlong_w(w_long))
except OperationError, e:
if not e.match(space, space.w_OverflowError):
raise
if space.is_true(space.gt(w_long, space.wrap(0))):
- overflow_ptr[0] = rffi.cast(rffi.INT_real, 1)
+ overflow_ptr[0] = rffi.cast(rffi.INT, 1)
else:
- overflow_ptr[0] = rffi.cast(rffi.INT_real, -1)
+ overflow_ptr[0] = rffi.cast(rffi.INT, -1)
return -1
@cpython_api([lltype.Float], PyObject)
@@ -133,7 +133,7 @@
OverflowError exception is raised and -1.0 will be returned."""
return space.float_w(space.float(w_long))
- at cpython_api([CONST_STRING, rffi.CCHARPP, rffi.INT_real], PyObject)
+ at cpython_api([CONST_STRING, rffi.CCHARPP, rffi.INT], PyObject)
def PyLong_FromString(space, str, pend, base):
"""Return a new PyLongObject based on the string value in str, which is
interpreted according to the radix in base. If pend is non-NULL,
@@ -172,7 +172,7 @@
def _PyLong_NumBits(space, w_long):
return space.uint_w(space.call_method(w_long, "bit_length"))
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def _PyLong_Sign(space, w_long):
assert isinstance(w_long, W_LongObject)
return w_long.num.sign
diff --git a/pypy/module/cpyext/modsupport.py b/pypy/module/cpyext/modsupport.py
--- a/pypy/module/cpyext/modsupport.py
+++ b/pypy/module/cpyext/modsupport.py
@@ -34,7 +34,7 @@
# This is actually the Py_InitModule4 function,
# renamed to refuse modules built against CPython headers.
@cpython_api([CONST_STRING, lltype.Ptr(PyMethodDef), CONST_STRING,
- PyObject, rffi.INT_real], PyObject)
+ PyObject, rffi.INT], PyObject)
def _Py_InitPyPyModule(space, name, methods, doc, w_self, apiver):
"""
Create a new module object based on a name and table of functions, returning
@@ -102,7 +102,7 @@
dict_w[methodname] = w_obj
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyModule_Check(space, w_obj):
w_type = space.gettypeobject(Module.typedef)
w_obj_type = space.type(w_obj)
diff --git a/pypy/module/cpyext/eval.py b/pypy/module/cpyext/eval.py
--- a/pypy/module/cpyext/eval.py
+++ b/pypy/module/cpyext/eval.py
@@ -84,7 +84,7 @@
w_code = compiling.compile(space, w_source, filename, mode)
return compiling.eval(space, w_code, w_globals, w_locals)
- at cpython_api([CONST_STRING, rffi.INT_real,PyObject, PyObject], PyObject)
+ at cpython_api([CONST_STRING, rffi.INT,PyObject, PyObject], PyObject)
def PyRun_String(space, source, start, w_globals, w_locals):
"""This is a simplified interface to PyRun_StringFlags() below, leaving
flags set to NULL."""
@@ -92,7 +92,7 @@
filename = "<string>"
return run_string(space, source, filename, start, w_globals, w_locals)
- at cpython_api([FILEP, CONST_STRING, rffi.INT_real, PyObject, PyObject], PyObject)
+ at cpython_api([FILEP, CONST_STRING, rffi.INT, PyObject, PyObject], PyObject)
def PyRun_File(space, fp, filename, start, w_globals, w_locals):
"""This is a simplified interface to PyRun_FileExFlags() below, leaving
closeit set to 0 and flags set to NULL."""
@@ -113,7 +113,7 @@
return run_string(space, source, filename, start, w_globals, w_locals)
# Undocumented function!
- at cpython_api([PyObject, Py_ssize_tP], rffi.INT_real, error=0)
+ at cpython_api([PyObject, Py_ssize_tP], rffi.INT, error=0)
def _PyEval_SliceIndex(space, w_obj, pi):
"""Extract a slice index from a PyInt or PyLong or an object with the
nb_index slot defined, and store in *pi.
diff --git a/pypy/module/cpyext/cdatetime.py b/pypy/module/cpyext/cdatetime.py
--- a/pypy/module/cpyext/cdatetime.py
+++ b/pypy/module/cpyext/cdatetime.py
@@ -54,7 +54,7 @@
# Check functions
def make_check_function(func_name, type_name):
- @cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ @cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
@func_renamer(func_name)
def check(space, w_obj):
try:
@@ -66,7 +66,7 @@
except OperationError:
return 0
- @cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ @cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
@func_renamer(func_name + "Exact")
def check_exact(space, w_obj):
try:
@@ -85,7 +85,7 @@
# Constructors
- at cpython_api([rffi.INT_real, rffi.INT_real, rffi.INT_real], PyObject)
+ at cpython_api([rffi.INT, rffi.INT, rffi.INT], PyObject)
def PyDate_FromDate(space, year, month, day):
"""Return a datetime.date object with the specified year, month and day.
"""
@@ -97,7 +97,7 @@
w_datetime, "date",
space.wrap(year), space.wrap(month), space.wrap(day))
- at cpython_api([rffi.INT_real, rffi.INT_real, rffi.INT_real, rffi.INT_real], PyObject)
+ at cpython_api([rffi.INT, rffi.INT, rffi.INT, rffi.INT], PyObject)
def PyTime_FromTime(space, hour, minute, second, usecond):
"""Return a ``datetime.time`` object with the specified hour, minute, second and
microsecond."""
@@ -111,7 +111,7 @@
space.wrap(hour), space.wrap(minute), space.wrap(second),
space.wrap(usecond))
- at cpython_api([rffi.INT_real, rffi.INT_real, rffi.INT_real, rffi.INT_real, rffi.INT_real, rffi.INT_real, rffi.INT_real], PyObject)
+ at cpython_api([rffi.INT, rffi.INT, rffi.INT, rffi.INT, rffi.INT, rffi.INT, rffi.INT], PyObject)
def PyDateTime_FromDateAndTime(space, year, month, day, hour, minute, second, usecond):
"""Return a datetime.datetime object with the specified year, month, day, hour,
minute, second and microsecond.
@@ -150,7 +150,7 @@
w_method = space.getattr(w_type, space.wrap("fromtimestamp"))
return space.call(w_method, w_args)
- at cpython_api([rffi.INT_real, rffi.INT_real, rffi.INT_real], PyObject)
+ at cpython_api([rffi.INT, rffi.INT, rffi.INT], PyObject)
def PyDelta_FromDSU(space, days, seconds, useconds):
"""Return a datetime.timedelta object representing the given number of days,
seconds and microseconds. Normalization is performed so that the resulting
@@ -167,67 +167,67 @@
# Accessors
- at cpython_api([PyDateTime_Date], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyDateTime_Date], rffi.INT, error=CANNOT_FAIL)
def PyDateTime_GET_YEAR(space, w_obj):
"""Return the year, as a positive int.
"""
return space.int_w(space.getattr(w_obj, space.wrap("year")))
- at cpython_api([PyDateTime_Date], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyDateTime_Date], rffi.INT, error=CANNOT_FAIL)
def PyDateTime_GET_MONTH(space, w_obj):
"""Return the month, as an int from 1 through 12.
"""
return space.int_w(space.getattr(w_obj, space.wrap("month")))
- at cpython_api([PyDateTime_Date], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyDateTime_Date], rffi.INT, error=CANNOT_FAIL)
def PyDateTime_GET_DAY(space, w_obj):
"""Return the day, as an int from 1 through 31.
"""
return space.int_w(space.getattr(w_obj, space.wrap("day")))
- at cpython_api([PyDateTime_DateTime], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyDateTime_DateTime], rffi.INT, error=CANNOT_FAIL)
def PyDateTime_DATE_GET_HOUR(space, w_obj):
"""Return the hour, as an int from 0 through 23.
"""
return space.int_w(space.getattr(w_obj, space.wrap("hour")))
- at cpython_api([PyDateTime_DateTime], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyDateTime_DateTime], rffi.INT, error=CANNOT_FAIL)
def PyDateTime_DATE_GET_MINUTE(space, w_obj):
"""Return the minute, as an int from 0 through 59.
"""
return space.int_w(space.getattr(w_obj, space.wrap("minute")))
- at cpython_api([PyDateTime_DateTime], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyDateTime_DateTime], rffi.INT, error=CANNOT_FAIL)
def PyDateTime_DATE_GET_SECOND(space, w_obj):
"""Return the second, as an int from 0 through 59.
"""
return space.int_w(space.getattr(w_obj, space.wrap("second")))
- at cpython_api([PyDateTime_DateTime], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyDateTime_DateTime], rffi.INT, error=CANNOT_FAIL)
def PyDateTime_DATE_GET_MICROSECOND(space, w_obj):
"""Return the microsecond, as an int from 0 through 999999.
"""
return space.int_w(space.getattr(w_obj, space.wrap("microsecond")))
- at cpython_api([PyDateTime_Time], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyDateTime_Time], rffi.INT, error=CANNOT_FAIL)
def PyDateTime_TIME_GET_HOUR(space, w_obj):
"""Return the hour, as an int from 0 through 23.
"""
return space.int_w(space.getattr(w_obj, space.wrap("hour")))
- at cpython_api([PyDateTime_Time], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyDateTime_Time], rffi.INT, error=CANNOT_FAIL)
def PyDateTime_TIME_GET_MINUTE(space, w_obj):
"""Return the minute, as an int from 0 through 59.
"""
return space.int_w(space.getattr(w_obj, space.wrap("minute")))
- at cpython_api([PyDateTime_Time], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyDateTime_Time], rffi.INT, error=CANNOT_FAIL)
def PyDateTime_TIME_GET_SECOND(space, w_obj):
"""Return the second, as an int from 0 through 59.
"""
return space.int_w(space.getattr(w_obj, space.wrap("second")))
- at cpython_api([PyDateTime_Time], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyDateTime_Time], rffi.INT, error=CANNOT_FAIL)
def PyDateTime_TIME_GET_MICROSECOND(space, w_obj):
"""Return the microsecond, as an int from 0 through 999999.
"""
@@ -237,14 +237,14 @@
# But it does not seem possible to expose a different structure
# for types defined in a python module like lib/datetime.py.
- at cpython_api([PyDateTime_Delta], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyDateTime_Delta], rffi.INT, error=CANNOT_FAIL)
def PyDateTime_DELTA_GET_DAYS(space, w_obj):
return space.int_w(space.getattr(w_obj, space.wrap("days")))
- at cpython_api([PyDateTime_Delta], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyDateTime_Delta], rffi.INT, error=CANNOT_FAIL)
def PyDateTime_DELTA_GET_SECONDS(space, w_obj):
return space.int_w(space.getattr(w_obj, space.wrap("seconds")))
- at cpython_api([PyDateTime_Delta], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyDateTime_Delta], rffi.INT, error=CANNOT_FAIL)
def PyDateTime_DELTA_GET_MICROSECONDS(space, w_obj):
return space.int_w(space.getattr(w_obj, space.wrap("microseconds")))
diff --git a/pypy/module/cpyext/listobject.py b/pypy/module/cpyext/listobject.py
--- a/pypy/module/cpyext/listobject.py
+++ b/pypy/module/cpyext/listobject.py
@@ -21,7 +21,7 @@
"""
return space.newlist([None] * len)
- at cpython_api([PyObject, Py_ssize_t, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, Py_ssize_t, PyObject], rffi.INT, error=-1)
def PyList_SetItem(space, w_list, index, w_item):
"""Set the item at index index in list to item. Return 0 on success
or -1 on failure.
@@ -54,14 +54,14 @@
return borrow_from(w_list, wrappeditems[index])
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PyList_Append(space, w_list, w_item):
if not isinstance(w_list, W_ListObject):
PyErr_BadInternalCall(space)
w_list.append(w_item)
return 0
- at cpython_api([PyObject, Py_ssize_t, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, Py_ssize_t, PyObject], rffi.INT, error=-1)
def PyList_Insert(space, w_list, index, w_item):
"""Insert the item item into list list in front of index index. Return
0 if successful; return -1 and set an exception if unsuccessful.
@@ -93,7 +93,7 @@
tuple(list)."""
return space.call_function(space.w_tuple, w_list)
- at cpython_api([PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject], rffi.INT, error=-1)
def PyList_Sort(space, w_list):
"""Sort the items of list in place. Return 0 on success, -1 on
failure. This is equivalent to list.sort()."""
@@ -102,7 +102,7 @@
space.call_method(w_list, "sort")
return 0
- at cpython_api([PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject], rffi.INT, error=-1)
def PyList_Reverse(space, w_list):
"""Reverse the items of list in place. Return 0 on success, -1 on
failure. This is the equivalent of list.reverse()."""
@@ -111,7 +111,7 @@
space.call_method(w_list, "reverse")
return 0
- at cpython_api([PyObject, Py_ssize_t, Py_ssize_t, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, Py_ssize_t, Py_ssize_t, PyObject], rffi.INT, error=-1)
def PyList_SetSlice(space, w_list, low, high, w_sequence):
"""Set the slice of list between low and high to the contents of
itemlist. Analogous to list[low:high] = itemlist. The itemlist may
diff --git a/pypy/module/cpyext/stubs.py b/pypy/module/cpyext/stubs.py
--- a/pypy/module/cpyext/stubs.py
+++ b/pypy/module/cpyext/stubs.py
@@ -34,12 +34,12 @@
def _PyObject_Del(space, op):
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyObject_CheckBuffer(space, obj):
"""Return 1 if obj supports the buffer interface otherwise 0."""
raise NotImplementedError
- at cpython_api([PyObject, Py_buffer, rffi.INT_real], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, Py_buffer, rffi.INT], rffi.INT, error=-1)
def PyObject_GetBuffer(space, obj, view, flags):
"""Export obj into a Py_buffer, view. These arguments must
never be NULL. The flags argument is a bit field indicating what
@@ -185,21 +185,21 @@
~Py_buffer.format."""
raise NotImplementedError
- at cpython_api([Py_buffer, lltype.Char], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([Py_buffer, lltype.Char], rffi.INT, error=CANNOT_FAIL)
def PyBuffer_IsContiguous(space, view, fortran):
"""Return 1 if the memory defined by the view is C-style (fortran is
'C') or Fortran-style (fortran is 'F') contiguous or either one
(fortran is 'A'). Return 0 otherwise."""
raise NotImplementedError
- at cpython_api([rffi.INT_real, Py_ssize_t, Py_ssize_t, Py_ssize_t, lltype.Char], lltype.Void)
+ at cpython_api([rffi.INT, Py_ssize_t, Py_ssize_t, Py_ssize_t, lltype.Char], lltype.Void)
def PyBuffer_FillContiguousStrides(space, ndim, shape, strides, itemsize, fortran):
"""Fill the strides array with byte-strides of a contiguous (C-style if
fortran is 'C' or Fortran-style if fortran is 'F' array of the
given shape with the given number of bytes per element."""
raise NotImplementedError
- at cpython_api([Py_buffer, PyObject, rffi.VOIDP, Py_ssize_t, rffi.INT_real, rffi.INT_real], rffi.INT_real, error=-1)
+ at cpython_api([Py_buffer, PyObject, rffi.VOIDP, Py_ssize_t, rffi.INT, rffi.INT], rffi.INT, error=-1)
def PyBuffer_FillInfo(space, view, obj, buf, len, readonly, infoflags):
"""Fill in a buffer-info structure, view, correctly for an exporter that can
only share a contiguous chunk of memory of "unsigned bytes" of the given
@@ -214,7 +214,7 @@
memoryview object."""
raise NotImplementedError
- at cpython_api([PyObject, rffi.INT_real, lltype.Char], PyObject)
+ at cpython_api([PyObject, rffi.INT, lltype.Char], PyObject)
def PyMemoryView_GetContiguous(space, obj, buffertype, order):
"""Create a memoryview object to a contiguous chunk of memory (in either
'C' or 'F'ortran order) from an object that defines the buffer
@@ -223,7 +223,7 @@
new bytes object."""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyMemoryView_Check(space, obj):
"""Return true if the object obj is a memoryview object. It is not
currently allowed to create subclasses of memoryview."""
@@ -236,13 +236,13 @@
check its type, you must do it yourself or you will risk crashes."""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, 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."""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyByteArray_CheckExact(space, o):
"""Return true if the object o is a bytearray object, but not an instance of a
subtype of the bytearray type."""
@@ -278,7 +278,7 @@
NULL pointer."""
raise NotImplementedError
- at cpython_api([PyObject, Py_ssize_t], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, Py_ssize_t], rffi.INT, error=-1)
def PyByteArray_Resize(space, bytearray, len):
"""Resize the internal buffer of bytearray to len."""
raise NotImplementedError
@@ -293,7 +293,7 @@
"""Macro version of PyByteArray_Size()."""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyCell_Check(space, ob):
"""Return true if ob is a cell object; ob must not be NULL."""
raise NotImplementedError
@@ -316,7 +316,7 @@
borrow_from()
raise NotImplementedError
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PyCell_Set(space, cell, value):
"""Set the contents of the cell object cell to value. This releases the
reference to any current content of the cell. value may be NULL. cell
@@ -331,7 +331,7 @@
be a cell object."""
raise NotImplementedError
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=CANNOT_FAIL)
def PyClass_IsSubclass(space, klass, base):
"""Return true if klass is a subclass of base. Return false in all other cases."""
raise NotImplementedError
@@ -342,17 +342,17 @@
used as the positional and keyword parameters to the object's constructor."""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyCode_Check(space, co):
"""Return true if co is a code object"""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyCode_GetNumFree(space, co):
"""Return the number of free variables in co."""
raise NotImplementedError
- at cpython_api([rffi.INT_real, rffi.INT_real, rffi.INT_real, rffi.INT_real, PyObject, PyObject, PyObject, PyObject, PyObject, PyObject, PyObject, PyObject, rffi.INT_real, PyObject], PyCodeObject)
+ at cpython_api([rffi.INT, rffi.INT, rffi.INT, rffi.INT, PyObject, PyObject, PyObject, PyObject, PyObject, PyObject, PyObject, PyObject, rffi.INT, PyObject], PyCodeObject)
def PyCode_New(space, argcount, nlocals, stacksize, flags, code, consts, names, varnames, freevars, cellvars, filename, name, firstlineno, lnotab):
"""Return a new code object. If you need a dummy code object to
create a frame, use PyCode_NewEmpty() instead. Calling
@@ -360,7 +360,7 @@
version since the definition of the bytecode changes often."""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject], rffi.INT, error=-1)
def PyCodec_Register(space, search_function):
"""Register a new codec search function.
@@ -408,7 +408,7 @@
"""Get a StreamWriter factory function for the given encoding."""
raise NotImplementedError
- at cpython_api([rffi.CCHARP, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([rffi.CCHARP, PyObject], rffi.INT, error=-1)
def PyCodec_RegisterError(space, name, error):
"""Register the error handling callback function error under the given name.
This callback function will be called by a codec when it encounters
@@ -563,7 +563,7 @@
instead."""
raise NotImplementedError
- at cpython_api([rffi.DOUBLE, lltype.Char, rffi.INT_real, rffi.INT_real, rffi.INTP], rffi.CCHARP)
+ at cpython_api([rffi.DOUBLE, lltype.Char, rffi.INT, rffi.INT, rffi.INTP], rffi.CCHARP)
def PyOS_double_to_string(space, val, format_code, precision, flags, ptype):
"""Convert a double val to a string using supplied
format_code, precision, and flags.
@@ -619,14 +619,14 @@
"""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyTZInfo_Check(space, ob):
"""Return true if ob is of type PyDateTime_TZInfoType or a subtype of
PyDateTime_TZInfoType. ob must not be NULL.
"""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyTZInfo_CheckExact(space, ob):
"""Return true if ob is of type PyDateTime_TZInfoType. ob must not be
NULL.
@@ -653,7 +653,7 @@
def PyDescr_NewClassMethod(space, type, method):
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyDescr_IsData(space, descr):
"""Return true if the descriptor objects descr describes a data attribute, or
false if it describes a method. descr must be a descriptor object; there is
@@ -673,7 +673,7 @@
"""
raise NotImplementedError
- at cpython_api([PyObject, PyObject, rffi.INT_real], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject, rffi.INT], rffi.INT, error=-1)
def PyDict_Merge(space, a, b, override):
"""Iterate over mapping object b adding key-value pairs to dictionary a.
b may be a dictionary, or any object supporting PyMapping_Keys()
@@ -684,7 +684,7 @@
"""
raise NotImplementedError
- at cpython_api([PyObject, PyObject, rffi.INT_real], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject, rffi.INT], rffi.INT, error=-1)
def PyDict_MergeFromSeq2(space, a, seq2, override):
"""Update or merge into dictionary a, from the key-value pairs in seq2.
seq2 must be an iterable object producing iterable objects of length 2,
@@ -700,7 +700,7 @@
"""
raise NotImplementedError
- at cpython_api([rffi.INT_real], PyObject)
+ at cpython_api([rffi.INT], PyObject)
def PyErr_SetFromWindowsErr(space, ierr):
"""This is a convenience function to raise WindowsError. If called with
ierr of 0, the error code returned by a call to GetLastError()
@@ -713,7 +713,7 @@
Return value: always NULL."""
raise NotImplementedError
- at cpython_api([PyObject, rffi.INT_real], PyObject)
+ at cpython_api([PyObject, rffi.INT], PyObject)
def PyErr_SetExcFromWindowsErr(space, type, ierr):
"""Similar to PyErr_SetFromWindowsErr(), with an additional parameter
specifying the exception type to be raised. Availability: Windows.
@@ -721,7 +721,7 @@
Return value: always NULL."""
raise NotImplementedError
- at cpython_api([rffi.INT_real, rffi.CCHARP], PyObject)
+ at cpython_api([rffi.INT, rffi.CCHARP], PyObject)
def PyErr_SetFromWindowsErrWithFilename(space, ierr, filename):
"""Similar to PyErr_SetFromWindowsErr(), with the additional behavior that
if filename is not NULL, it is passed to the constructor of
@@ -729,7 +729,7 @@
Return value: always NULL."""
raise NotImplementedError
- at cpython_api([PyObject, rffi.INT_real, rffi.CCHARP], PyObject)
+ at cpython_api([PyObject, rffi.INT, rffi.CCHARP], PyObject)
def PyErr_SetExcFromWindowsErrWithFilename(space, type, ierr, filename):
"""Similar to PyErr_SetFromWindowsErrWithFilename(), with an additional
parameter specifying the exception type to be raised. Availability: Windows.
@@ -737,7 +737,7 @@
Return value: always NULL."""
raise NotImplementedError
- at cpython_api([PyObject, rffi.CCHARP, rffi.CCHARP, rffi.INT_real, rffi.CCHARP, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, rffi.CCHARP, rffi.CCHARP, rffi.INT, rffi.CCHARP, PyObject], rffi.INT, error=-1)
def PyErr_WarnExplicit(space, category, message, filename, lineno, module, registry):
"""Issue a warning message with explicit control over all warning attributes. This
is a straightforward wrapper around the Python function
@@ -753,7 +753,7 @@
It may be called without holding the interpreter lock."""
raise NotImplementedError
- at cpython_api([rffi.INT_real], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([rffi.INT], rffi.INT, error=CANNOT_FAIL)
def PySignal_SetWakeupFd(space, fd):
"""This utility function specifies a file descriptor to which a '\0' byte will
be written whenever a signal is received. It returns the previous such file
@@ -791,27 +791,27 @@
"""Return the object attribute of the given exception object."""
raise NotImplementedError
- at cpython_api([PyObject, Py_ssize_t], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, Py_ssize_t], rffi.INT, error=-1)
def PyUnicodeDecodeError_GetStart(space, exc, start):
"""Get the start attribute of the given exception object and place it into
*start. start must not be NULL. Return 0 on success, -1 on
failure."""
raise NotImplementedError
- at cpython_api([PyObject, Py_ssize_t], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, Py_ssize_t], rffi.INT, error=-1)
def PyUnicodeDecodeError_SetStart(space, exc, start):
"""Set the start attribute of the given exception object to start. Return
0 on success, -1 on failure."""
raise NotImplementedError
- at cpython_api([PyObject, Py_ssize_t], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, Py_ssize_t], rffi.INT, error=-1)
def PyUnicodeDecodeError_GetEnd(space, exc, end):
"""Get the end attribute of the given exception object and place it into
*end. end must not be NULL. Return 0 on success, -1 on
failure."""
raise NotImplementedError
- at cpython_api([PyObject, Py_ssize_t], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, Py_ssize_t], rffi.INT, error=-1)
def PyUnicodeDecodeError_SetEnd(space, exc, end):
"""Set the end attribute of the given exception object to end. Return 0
on success, -1 on failure."""
@@ -822,13 +822,13 @@
"""Return the reason attribute of the given exception object."""
raise NotImplementedError
- at cpython_api([PyObject, rffi.CCHARP], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, rffi.CCHARP], rffi.INT, error=-1)
def PyUnicodeDecodeError_SetReason(space, exc, reason):
"""Set the reason attribute of the given exception object to reason. Return
0 on success, -1 on failure."""
raise NotImplementedError
- at cpython_api([rffi.CCHARP], rffi.INT_real, error=1)
+ at cpython_api([rffi.CCHARP], rffi.INT, error=1)
def Py_EnterRecursiveCall(space, where):
"""Marks a point where a recursive C-level call is about to be performed.
@@ -851,7 +851,7 @@
successful invocation of Py_EnterRecursiveCall()."""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP, rffi.CCHARP, rffi.INT_real], PyObject)
+ at cpython_api([FILE, rffi.CCHARP, rffi.CCHARP, rffi.INT], PyObject)
def PyFile_FromFile(space, fp, name, mode, close):
"""Create a new PyFileObject from the already-open standard C file
pointer, fp. The function close will be called when the file should be
@@ -900,27 +900,27 @@
borrow_from()
raise NotImplementedError
- at cpython_api([PyFileObject, rffi.INT_real], lltype.Void)
+ at cpython_api([PyFileObject, rffi.INT], lltype.Void)
def PyFile_SetBufSize(space, p, n):
"""Available on systems with setvbuf() only. This should only be called
immediately after file object creation."""
raise NotImplementedError
- at cpython_api([PyFileObject, rffi.CCHARP], rffi.INT_real, error=0)
+ at cpython_api([PyFileObject, rffi.CCHARP], rffi.INT, error=0)
def PyFile_SetEncoding(space, p, enc):
"""Set the file's encoding for Unicode output to enc. Return 1 on success and 0
on failure.
"""
raise NotImplementedError
- at cpython_api([PyFileObject, rffi.CCHARP, rffi.CCHARP], rffi.INT_real, error=0)
+ at cpython_api([PyFileObject, rffi.CCHARP, rffi.CCHARP], rffi.INT, error=0)
def PyFile_SetEncodingAndErrors(space, p, enc, errors):
"""Set the file's encoding for Unicode output to enc, and its error
mode to err. Return 1 on success and 0 on failure.
"""
raise NotImplementedError
- at cpython_api([PyObject, rffi.INT_real], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject, rffi.INT], rffi.INT, error=CANNOT_FAIL)
def PyFile_SoftSpace(space, p, newflag):
"""
This function exists for internal use by the interpreter. Set the
@@ -933,7 +933,7 @@
but doing so should not be needed."""
raise NotImplementedError
- at cpython_api([PyObject, PyObject, rffi.INT_real], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject, rffi.INT], rffi.INT, error=-1)
def PyFile_WriteObject(space, obj, p, flags):
"""
Write object obj to file object p. The only supported flag for flags is
@@ -942,7 +942,7 @@
appropriate exception will be set."""
raise NotImplementedError
- at cpython_api([rffi.CCHARP, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([rffi.CCHARP, PyObject], rffi.INT, error=-1)
def PyFile_WriteString(space, s, p):
"""Write string s to file object p. Return 0 on success or -1 on
failure; the appropriate exception will be set."""
@@ -968,7 +968,7 @@
"""
raise NotImplementedError
- at cpython_api([], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([], rffi.INT, error=CANNOT_FAIL)
def PyFloat_ClearFreeList(space):
"""Clear the float free list. Return the number of items that could not
be freed.
@@ -1033,7 +1033,7 @@
borrow_from()
raise NotImplementedError
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PyFunction_SetDefaults(space, op, defaults):
"""Set the argument default values for the function object op. defaults must be
Py_None or a tuple.
@@ -1048,7 +1048,7 @@
borrow_from()
raise NotImplementedError
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PyFunction_SetClosure(space, op, closure):
"""Set the closure associated with the function object op. closure must be
Py_None or a tuple of cell objects.
@@ -1086,12 +1086,12 @@
extension modules."""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyGen_Check(space, ob):
"""Return true if ob is a generator object; ob must not be NULL."""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyGen_CheckExact(space, ob):
"""Return true if ob's type is PyGen_Type is a generator object; ob must not
be NULL."""
@@ -1122,7 +1122,7 @@
-1 as level, meaning relative import."""
raise NotImplementedError
- at cpython_api([rffi.CCHARP, PyObject, PyObject, PyObject, rffi.INT_real], PyObject)
+ at cpython_api([rffi.CCHARP, PyObject, PyObject, PyObject, rffi.INT], PyObject)
def PyImport_ImportModuleLevel(space, name, globals, locals, fromlist, level):
"""Import a module. This is best described by referring to the built-in Python
function __import__(), as the standard __import__() function calls
@@ -1239,7 +1239,7 @@
"""For internal use only."""
raise NotImplementedError
- at cpython_api([rffi.CCHARP], rffi.INT_real, error=-1)
+ at cpython_api([rffi.CCHARP], rffi.INT, error=-1)
def PyImport_ImportFrozenModule(space, name):
"""Load a frozen module named name. Return 1 for success, 0 if the
module is not found, and -1 with an exception set if the initialization
@@ -1248,7 +1248,7 @@
reload the module if it was already imported.)"""
raise NotImplementedError
- at cpython_api([rffi.CCHARP, rffi.VOIDP], rffi.INT_real, error=-1)
+ at cpython_api([rffi.CCHARP, rffi.VOIDP], rffi.INT, error=-1)
def PyImport_AppendInittab(space, name, initfunc):
"""Add a single module to the existing table of built-in modules. This is a
convenience wrapper around PyImport_ExtendInittab(), returning -1 if
@@ -1258,7 +1258,7 @@
Py_Initialize()."""
raise NotImplementedError
- at cpython_api([_inittab], rffi.INT_real, error=-1)
+ at cpython_api([_inittab], rffi.INT, error=-1)
def PyImport_ExtendInittab(space, newtab):
"""Add a collection of modules to the table of built-in modules. The newtab
array must end with a sentinel entry which contains NULL for the name
@@ -1282,7 +1282,7 @@
fails."""
raise NotImplementedError
- at cpython_api([rffi.INT_real], lltype.Void)
+ at cpython_api([rffi.INT], lltype.Void)
def Py_InitializeEx(space, initsigs):
"""This function works like Py_Initialize() if initsigs is 1. If
initsigs is 0, it skips initialization registration of signal handlers, which
@@ -1462,7 +1462,7 @@
sys.version."""
raise NotImplementedError
- at cpython_api([rffi.INT_real, rffi.CCHARPP, rffi.INT_real], lltype.Void)
+ at cpython_api([rffi.INT, rffi.CCHARPP, rffi.INT], lltype.Void)
def PySys_SetArgvEx(space, argc, argv, updatepath):
"""Set sys.argv based on argc and argv. These parameters are similar to
those passed to the program's main() function with the difference that the
@@ -1500,7 +1500,7 @@
check w/ Guido."""
raise NotImplementedError
- at cpython_api([rffi.INT_real, rffi.CCHARPP], lltype.Void)
+ at cpython_api([rffi.INT, rffi.CCHARPP], lltype.Void)
def PySys_SetArgv(space, argc, argv):
"""This function works like PySys_SetArgvEx() with updatepath set to 1."""
raise NotImplementedError
@@ -1564,7 +1564,7 @@
borrow_from()
raise NotImplementedError
- at cpython_api([lltype.Signed, PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([lltype.Signed, PyObject], rffi.INT, error=CANNOT_FAIL)
def PyThreadState_SetAsyncExc(space, id, exc):
"""Asynchronously raise an exception in a thread. The id argument is the thread
id of the target thread; exc is the exception object to be raised. This
@@ -1777,20 +1777,20 @@
as defined in the system header files)."""
raise NotImplementedError
- at cpython_api([], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([], rffi.INT, error=CANNOT_FAIL)
def PyInt_ClearFreeList(space):
"""Clear the integer free list. Return the number of items that could not
be freed.
"""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PySeqIter_Check(space, op):
"""Return true if the type of op is PySeqIter_Type.
"""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyCallIter_Check(space, op):
"""Return true if the type of op is PyCallIter_Type.
"""
@@ -1821,7 +1821,7 @@
"""
raise NotImplementedError
- at cpython_api([rffi.CWCHARP, Py_ssize_t, rffi.INT_real], PyObject)
+ at cpython_api([rffi.CWCHARP, Py_ssize_t, rffi.INT], PyObject)
def PyLong_FromUnicode(space, u, length, base):
"""Convert a sequence of Unicode digits to a Python long integer value. The first
parameter, u, points to the first character of the Unicode string, length
@@ -1841,19 +1841,19 @@
"""
raise NotImplementedError
- at cpython_api([PyObject, rffi.CCHARP], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, rffi.CCHARP], rffi.INT, error=-1)
def PyMapping_DelItemString(space, o, key):
"""Remove the mapping for object key from the object o. Return -1 on
failure. This is equivalent to the Python statement del o[key]."""
raise NotImplementedError
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PyMapping_DelItem(space, o, key):
"""Remove the mapping for object key from the object o. Return -1 on
failure. This is equivalent to the Python statement del o[key]."""
raise NotImplementedError
- at cpython_api([lltype.Signed, FILE, rffi.INT_real], lltype.Void)
+ at cpython_api([lltype.Signed, FILE, rffi.INT], lltype.Void)
def PyMarshal_WriteLongToFile(space, value, file, version):
"""Marshal a long integer, value, to file. This will only write
the least-significant 32 bits of value; regardless of the size of the
@@ -1862,14 +1862,14 @@
version indicates the file format."""
raise NotImplementedError
- at cpython_api([PyObject, FILE, rffi.INT_real], lltype.Void)
+ at cpython_api([PyObject, FILE, rffi.INT], lltype.Void)
def PyMarshal_WriteObjectToFile(space, value, file, version):
"""Marshal a Python object, value, to file.
version indicates the file format."""
raise NotImplementedError
- at cpython_api([PyObject, rffi.INT_real], PyObject)
+ at cpython_api([PyObject, rffi.INT], PyObject)
def PyMarshal_WriteObjectToString(space, value, version):
"""Return a string object containing the marshalled representation of value.
@@ -1883,7 +1883,7 @@
regardless of the native size of long."""
raise NotImplementedError
- at cpython_api([FILE], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([FILE], rffi.INT, error=CANNOT_FAIL)
def PyMarshal_ReadShortFromFile(space, file):
"""Return a C short from the data stream in a FILE* opened
for reading. Only a 16-bit value can be read in using this function,
@@ -1920,13 +1920,13 @@
changes in your code for properly supporting 64-bit systems."""
raise NotImplementedError
- at cpython_api([], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([], rffi.INT, error=CANNOT_FAIL)
def PyMethod_ClearFreeList(space):
"""Clear the free list. Return the total number of freed items.
"""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyModule_CheckExact(space, p):
"""Return true if p is a module object, but not a subtype of
PyModule_Type.
@@ -1947,7 +1947,7 @@
SystemError and return NULL."""
raise NotImplementedError
- at cpython_api([PyObject, rffi.INT], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, rffi.INT], rffi.INT, error=-1)
def PyModule_AddIntMacro(space, module, macro):
"""Add an int constant to module. The name and the value are taken from
macro. For example PyModule_AddConstant(module, AF_INET) adds the int
@@ -1956,13 +1956,13 @@
"""
raise NotImplementedError
- at cpython_api([PyObject, rffi.CCHARP], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, rffi.CCHARP], rffi.INT, error=-1)
def PyModule_AddStringMacro(space, module, macro):
"""Add a string constant to module.
"""
raise NotImplementedError
- at cpython_api([PyObjectP, PyObjectP], rffi.INT_real, error=-1)
+ at cpython_api([PyObjectP, PyObjectP], rffi.INT, error=-1)
def PyNumber_Coerce(space, p1, p2):
"""This function takes the addresses of two variables of type PyObject*. If
the objects pointed to by *p1 and *p2 have the same type, increment their
@@ -1974,7 +1974,7 @@
Python statement o1, o2 = coerce(o1, o2)."""
raise NotImplementedError
- at cpython_api([PyObjectP, PyObjectP], rffi.INT_real, error=-1)
+ at cpython_api([PyObjectP, PyObjectP], rffi.INT, error=-1)
def PyNumber_CoerceEx(space, p1, p2):
"""This function is similar to PyNumber_Coerce(), except that it returns
1 when the conversion is not possible and when no error is raised.
@@ -1988,7 +1988,7 @@
"""
raise NotImplementedError
- at cpython_api([PyObject, rffi.INT_real], PyObject)
+ at cpython_api([PyObject, rffi.INT], PyObject)
def PyNumber_ToBase(space, n, base):
"""Returns the integer n converted to base as a string with a base
marker of '0b', '0o', or '0x' if applicable. When
@@ -1998,7 +1998,7 @@
"""
raise NotImplementedError
- at cpython_api([PyObject, PyObject, rffi.INTP], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject, rffi.INTP], rffi.INT, error=-1)
def PyObject_Cmp(space, o1, o2, result):
"""Compare the values of o1 and o2 using a routine provided by o1, if one
exists, otherwise with a routine provided by o2. The result of the
@@ -2037,12 +2037,12 @@
borrow_from()
raise NotImplementedError
- at cpython_api([PyFrameObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyFrameObject], rffi.INT, error=CANNOT_FAIL)
def PyFrame_GetLineNumber(space, frame):
"""Return the line number that frame is currently executing."""
raise NotImplementedError
- at cpython_api([], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([], rffi.INT, error=CANNOT_FAIL)
def PyEval_GetRestricted(space):
"""If there is a current frame and it is executing in restricted mode, return true,
otherwise false."""
@@ -2121,32 +2121,32 @@
changes in your code for properly supporting 64-bit systems."""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PySet_Check(space, p):
"""Return true if p is a set object or an instance of a subtype.
"""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyFrozenSet_Check(space, p):
"""Return true if p is a frozenset object or an instance of a
subtype.
"""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyAnySet_Check(space, p):
"""Return true if p is a set object, a frozenset object, or an
instance of a subtype."""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyAnySet_CheckExact(space, p):
"""Return true if p is a set object or a frozenset object but
not an instance of a subtype."""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyFrozenSet_CheckExact(space, p):
"""Return true if p is a frozenset object but not an instance of a
subtype."""
@@ -2188,7 +2188,7 @@
"""Macro form of PySet_Size() without error checking."""
raise NotImplementedError
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PySet_Contains(space, anyset, key):
"""Return 1 if found, 0 if not found, and -1 if an error is encountered. Unlike
the Python __contains__() method, this function does not automatically
@@ -2197,7 +2197,7 @@
set, frozenset, or an instance of a subtype."""
raise NotImplementedError
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PySet_Add(space, set, key):
"""Add key to a set instance. Does not apply to frozenset
instances. Return 0 on success or -1 on failure. Raise a TypeError if
@@ -2210,7 +2210,7 @@
values of brand new frozensets before they are exposed to other code."""
raise NotImplementedError
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PySet_Discard(space, set, key):
"""Return 1 if found and removed, 0 if not found (no action taken), and -1 if an
error is encountered. Does not raise KeyError for missing keys. Raise a
@@ -2228,7 +2228,7 @@
set or its subtype."""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject], rffi.INT, error=-1)
def PySet_Clear(space, set):
"""Empty an existing set of all elements."""
raise NotImplementedError
@@ -2287,7 +2287,7 @@
changes in your code for properly supporting 64-bit systems."""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([FILE, rffi.CCHARP], rffi.INT, error=CANNOT_FAIL)
def Py_FdIsInteractive(space, fp, filename):
"""Return true (nonzero) if the standard I/O file fp with name filename is
deemed interactive. This is the case for files for which isatty(fileno(fp))
@@ -2304,7 +2304,7 @@
to be called."""
raise NotImplementedError
- at cpython_api([], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([], rffi.INT, error=CANNOT_FAIL)
def PyOS_CheckStack(space):
"""Return true when the interpreter runs out of stack space. This is a reliable
check, but is only available when USE_STACKCHECK is defined (currently
@@ -2313,7 +2313,7 @@
own code."""
raise NotImplementedError
- at cpython_api([rffi.INT_real], PyOS_sighandler_t)
+ at cpython_api([rffi.INT], PyOS_sighandler_t)
def PyOS_getsig(space, i):
"""Return the current signal handler for signal i. This is a thin wrapper around
either sigaction() or signal(). Do not call those functions
@@ -2321,7 +2321,7 @@
(*)(int)."""
raise NotImplementedError
- at cpython_api([rffi.INT_real, PyOS_sighandler_t], PyOS_sighandler_t)
+ at cpython_api([rffi.INT, PyOS_sighandler_t], PyOS_sighandler_t)
def PyOS_setsig(space, i, h):
"""Set the signal handler for signal i to be h; return the old signal handler.
This is a thin wrapper around either sigaction() or signal(). Do
@@ -2375,13 +2375,13 @@
"""As above, but write to sys.stderr or stderr instead."""
raise NotImplementedError
- at cpython_api([rffi.INT_real], lltype.Void)
+ at cpython_api([rffi.INT], lltype.Void)
def Py_Exit(space, status):
"""Exit the current process. This calls Py_Finalize() and then calls the
standard C library function exit(status)."""
raise NotImplementedError
- at cpython_api([rffi.VOIDP], rffi.INT_real, error=-1)
+ at cpython_api([rffi.VOIDP], rffi.INT, error=-1)
def Py_AtExit(space, func):
"""Register a cleanup function to be called by Py_Finalize(). The cleanup
function will be called with no arguments and should return no value. At
@@ -2402,7 +2402,7 @@
require changes in your code for properly supporting 64-bit systems."""
raise NotImplementedError
- at cpython_api([], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([], rffi.INT, error=CANNOT_FAIL)
def PyTuple_ClearFreeList(space):
"""Clear the free list. Return the total number of freed items.
"""
@@ -2422,35 +2422,35 @@
"""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyType_IS_GC(space, o):
"""Return true if the type object includes support for the cycle detector; this
tests the type flag Py_TPFLAGS_HAVE_GC.
"""
raise NotImplementedError
- at cpython_api([], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([], rffi.INT, error=CANNOT_FAIL)
def PyUnicode_ClearFreeList(space):
"""Clear the free list. Return the total number of freed items.
"""
raise NotImplementedError
- at cpython_api([Py_UNICODE], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([Py_UNICODE], rffi.INT, error=CANNOT_FAIL)
def Py_UNICODE_ISTITLE(space, ch):
"""Return 1 or 0 depending on whether ch is a titlecase character."""
raise NotImplementedError
- at cpython_api([Py_UNICODE], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([Py_UNICODE], rffi.INT, error=CANNOT_FAIL)
def Py_UNICODE_ISDIGIT(space, ch):
"""Return 1 or 0 depending on whether ch is a digit character."""
raise NotImplementedError
- at cpython_api([Py_UNICODE], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([Py_UNICODE], rffi.INT, error=CANNOT_FAIL)
def Py_UNICODE_ISNUMERIC(space, ch):
"""Return 1 or 0 depending on whether ch is a numeric character."""
raise NotImplementedError
- at cpython_api([Py_UNICODE], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([Py_UNICODE], rffi.INT, error=CANNOT_FAIL)
def Py_UNICODE_ISALPHA(space, ch):
"""Return 1 or 0 depending on whether ch is an alphabetic character."""
raise NotImplementedError
@@ -2460,13 +2460,13 @@
"""Return the character ch converted to title case."""
raise NotImplementedError
- at cpython_api([Py_UNICODE], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([Py_UNICODE], rffi.INT, error=CANNOT_FAIL)
def Py_UNICODE_TODECIMAL(space, ch):
"""Return the character ch converted to a decimal positive integer. Return
-1 if this is not possible. This macro does not raise exceptions."""
raise NotImplementedError
- at cpython_api([Py_UNICODE], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([Py_UNICODE], rffi.INT, error=CANNOT_FAIL)
def Py_UNICODE_TODIGIT(space, ch):
"""Return the character ch converted to a single digit integer. Return -1 if
this is not possible. This macro does not raise exceptions."""
@@ -2694,7 +2694,7 @@
"""
raise NotImplementedError
- at cpython_api([rffi.CWCHARP, Py_ssize_t, rffi.CCHARP, rffi.INT_real], PyObject)
+ at cpython_api([rffi.CWCHARP, Py_ssize_t, rffi.CCHARP, rffi.INT], PyObject)
def PyUnicode_EncodeUTF32(space, s, size, errors, byteorder):
"""Return a Python bytes object holding the UTF-32 encoded value of the Unicode
data in s. Output is written according to the following byte order:
@@ -2734,7 +2734,7 @@
properly supporting 64-bit systems."""
raise NotImplementedError
- at cpython_api([rffi.CWCHARP, Py_ssize_t, rffi.CCHARP, rffi.INT_real], PyObject)
+ at cpython_api([rffi.CWCHARP, Py_ssize_t, rffi.CCHARP, rffi.INT], PyObject)
def PyUnicode_EncodeUTF16(space, s, size, errors, byteorder):
"""Return a Python string object holding the UTF-16 encoded value of the Unicode
data in s. Output is written according to the following byte order:
@@ -2777,7 +2777,7 @@
bytes that have been decoded will be stored in consumed."""
raise NotImplementedError
- at cpython_api([rffi.CWCHARP, Py_ssize_t, rffi.INT_real, rffi.INT_real, rffi.CCHARP], PyObject)
+ at cpython_api([rffi.CWCHARP, Py_ssize_t, rffi.INT, rffi.INT, rffi.CCHARP], PyObject)
def PyUnicode_EncodeUTF7(space, s, size, base64SetO, base64WhiteSpace, errors):
"""Encode the Py_UNICODE buffer of the given size using UTF-7 and
return a Python bytes object. Return NULL if an exception was raised by
@@ -2908,7 +2908,7 @@
changes in your code for properly supporting 64-bit systems."""
raise NotImplementedError
- at cpython_api([rffi.CCHARP, rffi.INT_real, rffi.CCHARP, rffi.INTP], PyObject)
+ at cpython_api([rffi.CCHARP, rffi.INT, rffi.CCHARP, rffi.INTP], PyObject)
def PyUnicode_DecodeMBCSStateful(space, s, size, errors, consumed):
"""If consumed is NULL, behave like PyUnicode_DecodeMBCS(). If
consumed is not NULL, PyUnicode_DecodeMBCSStateful() will not decode
@@ -2940,7 +2940,7 @@
changes in your code for properly supporting 64-bit systems."""
raise NotImplementedError
- at cpython_api([PyObject, rffi.INT_real], PyObject)
+ at cpython_api([PyObject, rffi.INT], PyObject)
def PyUnicode_Splitlines(space, s, keepend):
"""Split a Unicode string at line breaks, returning a list of Unicode strings.
CRLF is considered to be one line break. If keepend is 0, the Line break
@@ -2969,7 +2969,7 @@
Unicode string."""
raise NotImplementedError
- at cpython_api([PyObject, PyObject, Py_ssize_t, Py_ssize_t, rffi.INT_real], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject, Py_ssize_t, Py_ssize_t, rffi.INT], rffi.INT, error=-1)
def PyUnicode_Tailmatch(space, str, substr, start, end, direction):
"""Return 1 if substr matches str*[*start:end] at the given tail end
(direction == -1 means to do a prefix match, direction == 1 a suffix match),
@@ -2980,7 +2980,7 @@
systems."""
raise NotImplementedError
- at cpython_api([PyObject, PyObject, Py_ssize_t, Py_ssize_t, rffi.INT_real], Py_ssize_t, error=-2)
+ at cpython_api([PyObject, PyObject, Py_ssize_t, Py_ssize_t, rffi.INT], Py_ssize_t, error=-2)
def PyUnicode_Find(space, str, substr, start, end, direction):
"""Return the first position of substr in str*[*start:end] using the given
direction (direction == 1 means to do a forward search, direction == -1 a
@@ -3013,7 +3013,7 @@
require changes in your code for properly supporting 64-bit systems."""
raise NotImplementedError
- at cpython_api([PyObject, PyObject, rffi.INT_real], PyObject)
+ at cpython_api([PyObject, PyObject, rffi.INT], PyObject)
def PyUnicode_RichCompare(space, left, right, op):
"""Rich compare two unicode strings and return one of the following:
@@ -3037,7 +3037,7 @@
format % args. The args argument must be a tuple."""
raise NotImplementedError
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-1)
def PyUnicode_Contains(space, container, element):
"""Check whether element is contained in container and return true or false
accordingly.
@@ -3046,7 +3046,7 @@
there was an error."""
raise NotImplementedError
- at cpython_api([rffi.INT_real, rffi.CCHARPP], rffi.INT_real, error=2)
+ at cpython_api([rffi.INT, rffi.CCHARPP], rffi.INT, error=2)
def Py_Main(space, argc, argv):
"""The main program for the standard interpreter. This is made available for
programs which embed Python. The argc and argv parameters should be
@@ -3062,25 +3062,25 @@
Py_InspectFlag is not set."""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP], rffi.INT_real, error=-1)
+ at cpython_api([FILE, rffi.CCHARP], rffi.INT, error=-1)
def PyRun_AnyFile(space, fp, filename):
"""This is a simplified interface to PyRun_AnyFileExFlags() below, leaving
closeit set to 0 and flags set to NULL."""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP, PyCompilerFlags], rffi.INT_real, error=-1)
+ at cpython_api([FILE, rffi.CCHARP, PyCompilerFlags], rffi.INT, error=-1)
def PyRun_AnyFileFlags(space, fp, filename, flags):
"""This is a simplified interface to PyRun_AnyFileExFlags() below, leaving
the closeit argument set to 0."""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP, rffi.INT_real], rffi.INT_real, error=-1)
+ at cpython_api([FILE, rffi.CCHARP, rffi.INT], rffi.INT, error=-1)
def PyRun_AnyFileEx(space, fp, filename, closeit):
"""This is a simplified interface to PyRun_AnyFileExFlags() below, leaving
the flags argument set to NULL."""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP, rffi.INT_real, PyCompilerFlags], rffi.INT_real, error=-1)
+ at cpython_api([FILE, rffi.CCHARP, rffi.INT, PyCompilerFlags], rffi.INT, error=-1)
def PyRun_AnyFileExFlags(space, fp, filename, closeit, flags):
"""If fp refers to a file associated with an interactive device (console or
terminal input or Unix pseudo-terminal), return the value of
@@ -3089,13 +3089,13 @@
"???" as the filename."""
raise NotImplementedError
- at cpython_api([rffi.CCHARP], rffi.INT_real, error=-1)
+ at cpython_api([rffi.CCHARP], rffi.INT, error=-1)
def PyRun_SimpleString(space, command):
"""This is a simplified interface to PyRun_SimpleStringFlags() below,
leaving the PyCompilerFlags* argument set to NULL."""
raise NotImplementedError
- at cpython_api([rffi.CCHARP, PyCompilerFlags], rffi.INT_real, error=-1)
+ at cpython_api([rffi.CCHARP, PyCompilerFlags], rffi.INT, error=-1)
def PyRun_SimpleStringFlags(space, command, flags):
"""Executes the Python source code from command in the __main__ module
according to the flags argument. If __main__ does not already exist, it
@@ -3108,25 +3108,25 @@
Py_InspectFlag is not set."""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP], rffi.INT_real, error=-1)
+ at cpython_api([FILE, rffi.CCHARP], rffi.INT, error=-1)
def PyRun_SimpleFile(space, fp, filename):
"""This is a simplified interface to PyRun_SimpleFileExFlags() below,
leaving closeit set to 0 and flags set to NULL."""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP, PyCompilerFlags], rffi.INT_real, error=-1)
+ at cpython_api([FILE, rffi.CCHARP, PyCompilerFlags], rffi.INT, error=-1)
def PyRun_SimpleFileFlags(space, fp, filename, flags):
"""This is a simplified interface to PyRun_SimpleFileExFlags() below,
leaving closeit set to 0."""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP, rffi.INT_real], rffi.INT_real, error=-1)
+ at cpython_api([FILE, rffi.CCHARP, rffi.INT], rffi.INT, error=-1)
def PyRun_SimpleFileEx(space, fp, filename, closeit):
"""This is a simplified interface to PyRun_SimpleFileExFlags() below,
leaving flags set to NULL."""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP, rffi.INT_real, PyCompilerFlags], rffi.INT_real, error=-1)
+ at cpython_api([FILE, rffi.CCHARP, rffi.INT, PyCompilerFlags], rffi.INT, error=-1)
def PyRun_SimpleFileExFlags(space, fp, filename, closeit, flags):
"""Similar to PyRun_SimpleStringFlags(), but the Python source code is read
from fp instead of an in-memory string. filename should be the name of the
@@ -3134,13 +3134,13 @@
returns."""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP], rffi.INT_real, error=-1)
+ at cpython_api([FILE, rffi.CCHARP], rffi.INT, error=-1)
def PyRun_InteractiveOne(space, fp, filename):
"""This is a simplified interface to PyRun_InteractiveOneFlags() below,
leaving flags set to NULL."""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP, PyCompilerFlags], rffi.INT_real, error=-1)
+ at cpython_api([FILE, rffi.CCHARP, PyCompilerFlags], rffi.INT, error=-1)
def PyRun_InteractiveOneFlags(space, fp, filename, flags):
"""Read and execute a single statement from a file associated with an
interactive device according to the flags argument. The user will be
@@ -3151,34 +3151,34 @@
Python.h, so must be included specifically if needed.)"""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP], rffi.INT_real, error=-1)
+ at cpython_api([FILE, rffi.CCHARP], rffi.INT, error=-1)
def PyRun_InteractiveLoop(space, fp, filename):
"""This is a simplified interface to PyRun_InteractiveLoopFlags() below,
leaving flags set to NULL."""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP, PyCompilerFlags], rffi.INT_real, error=-1)
+ at cpython_api([FILE, rffi.CCHARP, PyCompilerFlags], rffi.INT, error=-1)
def PyRun_InteractiveLoopFlags(space, fp, filename, flags):
"""Read and execute statements from a file associated with an interactive device
until EOF is reached. The user will be prompted using sys.ps1 and
sys.ps2. Returns 0 at EOF."""
raise NotImplementedError
- at cpython_api([rffi.CCHARP, rffi.INT_real], _node)
+ at cpython_api([rffi.CCHARP, rffi.INT], _node)
def PyParser_SimpleParseString(space, str, start):
"""This is a simplified interface to
PyParser_SimpleParseStringFlagsFilename() below, leaving filename set
to NULL and flags set to 0."""
raise NotImplementedError
- at cpython_api([rffi.CCHARP, rffi.INT_real, rffi.INT_real], _node)
+ at cpython_api([rffi.CCHARP, rffi.INT, rffi.INT], _node)
def PyParser_SimpleParseStringFlags(space, str, start, flags):
"""This is a simplified interface to
PyParser_SimpleParseStringFlagsFilename() below, leaving filename set
to NULL."""
raise NotImplementedError
- at cpython_api([rffi.CCHARP, rffi.CCHARP, rffi.INT_real, rffi.INT_real], _node)
+ at cpython_api([rffi.CCHARP, rffi.CCHARP, rffi.INT, rffi.INT], _node)
def PyParser_SimpleParseStringFlagsFilename(space, str, filename, start, flags):
"""Parse Python source code from str using the start token start according to
the flags argument. The result can be used to create a code object which can
@@ -3186,19 +3186,19 @@
many times."""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP, rffi.INT_real], _node)
+ at cpython_api([FILE, rffi.CCHARP, rffi.INT], _node)
def PyParser_SimpleParseFile(space, fp, filename, start):
"""This is a simplified interface to PyParser_SimpleParseFileFlags() below,
leaving flags set to 0"""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP, rffi.INT_real, rffi.INT_real], _node)
+ at cpython_api([FILE, rffi.CCHARP, rffi.INT, rffi.INT], _node)
def PyParser_SimpleParseFileFlags(space, fp, filename, start, flags):
"""Similar to PyParser_SimpleParseStringFlagsFilename(), but the Python
source code is read from fp instead of an in-memory string."""
raise NotImplementedError
- at cpython_api([rffi.CCHARP, rffi.INT_real, PyObject, PyObject, PyCompilerFlags], PyObject)
+ at cpython_api([rffi.CCHARP, rffi.INT, PyObject, PyObject, PyCompilerFlags], PyObject)
def PyRun_StringFlags(space, str, start, globals, locals, flags):
"""Execute Python source code from str in the context specified by the
dictionaries globals and locals with the compiler flags specified by
@@ -3209,19 +3209,19 @@
exception was raised."""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP, rffi.INT_real, PyObject, PyObject, rffi.INT_real], PyObject)
+ at cpython_api([FILE, rffi.CCHARP, rffi.INT, PyObject, PyObject, rffi.INT], PyObject)
def PyRun_FileEx(space, fp, filename, start, globals, locals, closeit):
"""This is a simplified interface to PyRun_FileExFlags() below, leaving
flags set to NULL."""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP, rffi.INT_real, PyObject, PyObject, PyCompilerFlags], PyObject)
+ at cpython_api([FILE, rffi.CCHARP, rffi.INT, PyObject, PyObject, PyCompilerFlags], PyObject)
def PyRun_FileFlags(space, fp, filename, start, globals, locals, flags):
"""This is a simplified interface to PyRun_FileExFlags() below, leaving
closeit set to 0."""
raise NotImplementedError
- at cpython_api([FILE, rffi.CCHARP, rffi.INT_real, PyObject, PyObject, rffi.INT_real, PyCompilerFlags], PyObject)
+ at cpython_api([FILE, rffi.CCHARP, rffi.INT, PyObject, PyObject, rffi.INT, PyCompilerFlags], PyObject)
def PyRun_FileExFlags(space, fp, filename, start, globals, locals, closeit, flags):
"""Similar to PyRun_StringFlags(), but the Python source code is read from
fp instead of an in-memory string. filename should be the name of the file.
@@ -3229,13 +3229,13 @@
returns."""
raise NotImplementedError
- at cpython_api([rffi.CCHARP, rffi.CCHARP, rffi.INT_real], PyObject)
+ at cpython_api([rffi.CCHARP, rffi.CCHARP, rffi.INT], PyObject)
def Py_CompileString(space, str, filename, start):
"""This is a simplified interface to Py_CompileStringFlags() below, leaving
flags set to NULL."""
raise NotImplementedError
- at cpython_api([rffi.CCHARP, rffi.CCHARP, rffi.INT_real, PyCompilerFlags], PyObject)
+ at cpython_api([rffi.CCHARP, rffi.CCHARP, rffi.INT, PyCompilerFlags], PyObject)
def Py_CompileStringFlags(space, str, filename, start, flags):
"""Parse and compile the Python source code in str, returning the resulting code
object. The start token is given by start; this can be used to constrain the
@@ -3253,7 +3253,7 @@
The other arguments are set to NULL."""
raise NotImplementedError
- at cpython_api([PyCodeObject, PyObject, PyObject, PyObjectP, rffi.INT_real, PyObjectP, rffi.INT_real, PyObjectP, rffi.INT_real, PyObject], PyObject)
+ at cpython_api([PyCodeObject, PyObject, PyObject, PyObjectP, rffi.INT, PyObjectP, rffi.INT, PyObjectP, rffi.INT, PyObject], PyObject)
def PyEval_EvalCodeEx(space, co, globals, locals, args, argcount, kws, kwcount, defs, defcount, closure):
"""Evaluate a precompiled code object, given a particular environment for its
evaluation. This environment consists of dictionaries of global and local
@@ -3267,7 +3267,7 @@
PyEval_EvalFrameEx, for backward compatibility."""
raise NotImplementedError
- at cpython_api([PyFrameObject, rffi.INT_real], PyObject)
+ at cpython_api([PyFrameObject, rffi.INT], PyObject)
def PyEval_EvalFrameEx(space, f, throwflag):
"""This is the main, unvarnished function of Python interpretation. It is
literally 2000 lines long. The code object associated with the execution
@@ -3277,25 +3277,25 @@
throw() methods of generator objects."""
raise NotImplementedError
- at cpython_api([PyCompilerFlags], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyCompilerFlags], rffi.INT, error=CANNOT_FAIL)
def PyEval_MergeCompilerFlags(space, cf):
"""This function changes the flags of the current evaluation frame, and returns
true on success, false on failure."""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyWeakref_Check(space, ob):
"""Return true if ob is either a reference or proxy object.
"""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyWeakref_CheckRef(space, ob):
"""Return true if ob is a reference object.
"""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyWeakref_CheckProxy(space, ob):
"""Return true if ob is a proxy object.
"""
diff --git a/pypy/module/cpyext/pythonrun.py b/pypy/module/cpyext/pythonrun.py
--- a/pypy/module/cpyext/pythonrun.py
+++ b/pypy/module/cpyext/pythonrun.py
@@ -2,7 +2,7 @@
from pypy.module.cpyext.api import cpython_api, CANNOT_FAIL
from pypy.module.cpyext.state import State
- at cpython_api([], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([], rffi.INT, error=CANNOT_FAIL)
def Py_IsInitialized(space):
return 1
diff --git a/pypy/module/cpyext/stubgen.py b/pypy/module/cpyext/stubgen.py
--- a/pypy/module/cpyext/stubgen.py
+++ b/pypy/module/cpyext/stubgen.py
@@ -15,7 +15,7 @@
C_TYPE_TO_PYPY_TYPE = {
"void": "lltype.Void",
- "int": "rffi.INT_real",
+ "int": "rffi.INT",
"PyTypeObject*": "PyTypeObjectPtr",
"PyVarObject*": "PyObject",
"const char*": "rffi.CCHARP",
diff --git a/pypy/module/cpyext/number.py b/pypy/module/cpyext/number.py
--- a/pypy/module/cpyext/number.py
+++ b/pypy/module/cpyext/number.py
@@ -4,7 +4,7 @@
from pypy.rpython.lltypesystem import rffi, lltype
from pypy.tool.sourcetools import func_with_new_name
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyIndex_Check(space, w_obj):
"""Returns True if o is an index integer (has the nb_index slot of the
tp_as_number structure filled in).
@@ -15,7 +15,7 @@
except OperationError:
return 0
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyNumber_Check(space, w_obj):
"""Returns 1 if the object o provides numeric protocols, and false otherwise.
This function always succeeds."""
diff --git a/pypy/module/cpyext/iterator.py b/pypy/module/cpyext/iterator.py
--- a/pypy/module/cpyext/iterator.py
+++ b/pypy/module/cpyext/iterator.py
@@ -36,7 +36,7 @@
raise
return None
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyIter_Check(space, w_obj):
"""Return true if the object o supports the iterator protocol."""
try:
diff --git a/pypy/module/cpyext/structmember.py b/pypy/module/cpyext/structmember.py
--- a/pypy/module/cpyext/structmember.py
+++ b/pypy/module/cpyext/structmember.py
@@ -82,7 +82,7 @@
return w_result
- at cpython_api([PyObject, lltype.Ptr(PyMemberDef), PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, lltype.Ptr(PyMemberDef), PyObject], rffi.INT, error=-1)
def PyMember_SetOne(space, obj, w_member, w_value):
addr = rffi.cast(ADDR, obj)
addr += w_member.c_offset
diff --git a/pypy/module/cpyext/unicodeobject.py b/pypy/module/cpyext/unicodeobject.py
--- a/pypy/module/cpyext/unicodeobject.py
+++ b/pypy/module/cpyext/unicodeobject.py
@@ -52,32 +52,32 @@
from pypy.module.cpyext.object import PyObject_dealloc
PyObject_dealloc(space, py_obj)
- at cpython_api([Py_UNICODE], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([Py_UNICODE], rffi.INT, error=CANNOT_FAIL)
def Py_UNICODE_ISSPACE(space, ch):
"""Return 1 or 0 depending on whether ch is a whitespace character."""
return unicodedb.isspace(ord(ch))
- at cpython_api([Py_UNICODE], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([Py_UNICODE], rffi.INT, error=CANNOT_FAIL)
def Py_UNICODE_ISALNUM(space, ch):
"""Return 1 or 0 depending on whether ch is an alphanumeric character."""
return unicodedb.isalnum(ord(ch))
- at cpython_api([Py_UNICODE], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([Py_UNICODE], rffi.INT, error=CANNOT_FAIL)
def Py_UNICODE_ISLINEBREAK(space, ch):
"""Return 1 or 0 depending on whether ch is a linebreak character."""
return unicodedb.islinebreak(ord(ch))
- at cpython_api([Py_UNICODE], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([Py_UNICODE], rffi.INT, error=CANNOT_FAIL)
def Py_UNICODE_ISDECIMAL(space, ch):
"""Return 1 or 0 depending on whether ch is a decimal character."""
return unicodedb.isdecimal(ord(ch))
- at cpython_api([Py_UNICODE], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([Py_UNICODE], rffi.INT, error=CANNOT_FAIL)
def Py_UNICODE_ISLOWER(space, ch):
"""Return 1 or 0 depending on whether ch is a lowercase character."""
return unicodedb.islower(ord(ch))
- at cpython_api([Py_UNICODE], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([Py_UNICODE], rffi.INT, error=CANNOT_FAIL)
def Py_UNICODE_ISUPPER(space, ch):
"""Return 1 or 0 depending on whether ch is an uppercase character."""
return unicodedb.isupper(ord(ch))
@@ -179,7 +179,7 @@
i += 1
return default_encoding
- at cpython_api([CONST_STRING], rffi.INT_real, error=-1)
+ at cpython_api([CONST_STRING], rffi.INT, error=-1)
def PyUnicode_SetDefaultEncoding(space, encoding):
"""Sets the currently active default encoding. Returns 0 on
success, -1 in case of an error."""
@@ -442,7 +442,7 @@
w_errors = space.w_None
return space.call_method(w_str, 'decode', w_encoding, w_errors)
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=-2)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=-2)
def PyUnicode_Compare(space, w_left, w_right):
"""Compare two strings and return -1, 0, 1 for less than, equal, and greater
than, respectively."""
diff --git a/pypy/module/cpyext/stringobject.py b/pypy/module/cpyext/stringobject.py
--- a/pypy/module/cpyext/stringobject.py
+++ b/pypy/module/cpyext/stringobject.py
@@ -138,7 +138,7 @@
ref_str.c_buffer = rffi.str2charp(s)
return ref_str.c_buffer
- at cpython_api([PyObject, rffi.CCHARPP, rffi.CArrayPtr(Py_ssize_t)], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, rffi.CCHARPP, rffi.CArrayPtr(Py_ssize_t)], rffi.INT, error=-1)
def PyString_AsStringAndSize(space, ref, buffer, length):
if not PyString_Check(space, ref):
raise OperationError(space.w_TypeError, space.wrap(
@@ -170,7 +170,7 @@
w_obj = from_ref(space, ref)
return space.len_w(w_obj)
- at cpython_api([PyObjectP, Py_ssize_t], rffi.INT_real, error=-1)
+ at cpython_api([PyObjectP, Py_ssize_t], rffi.INT, error=-1)
def _PyString_Resize(space, ref, newsize):
"""A way to resize a string object even though it is "immutable". Only use this to
build up a brand new string object; don't use this if the string may already be
diff --git a/pypy/module/cpyext/mapping.py b/pypy/module/cpyext/mapping.py
--- a/pypy/module/cpyext/mapping.py
+++ b/pypy/module/cpyext/mapping.py
@@ -4,7 +4,7 @@
from pypy.module.cpyext.pyobject import PyObject
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject], rffi.INT, error=CANNOT_FAIL)
def PyMapping_Check(space, w_obj):
"""Return 1 if the object provides mapping protocol, and 0 otherwise. This
function always succeeds."""
@@ -44,7 +44,7 @@
w_key = space.wrap(rffi.charp2str(key))
return space.getitem(w_obj, w_key)
- at cpython_api([PyObject, CONST_STRING, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([PyObject, CONST_STRING, PyObject], rffi.INT, error=-1)
def PyMapping_SetItemString(space, w_obj, key, w_value):
"""Map the object key to the value v in object o. Returns -1 on failure.
This is the equivalent of the Python statement o[key] = v."""
@@ -52,7 +52,7 @@
space.setitem(w_obj, w_key, w_value)
return 0
- at cpython_api([PyObject, PyObject], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject, PyObject], rffi.INT, error=CANNOT_FAIL)
def PyMapping_HasKey(space, w_obj, w_key):
"""Return 1 if the mapping object has the key key and 0 otherwise.
This is equivalent to o[key], returning True on success and False
@@ -63,7 +63,7 @@
except:
return 0
- at cpython_api([PyObject, CONST_STRING], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([PyObject, CONST_STRING], rffi.INT, error=CANNOT_FAIL)
def PyMapping_HasKeyString(space, w_obj, key):
"""Return 1 if the mapping object has the key key and 0 otherwise.
This is equivalent to o[key], returning True on success and False
diff --git a/pypy/module/cpyext/sliceobject.py b/pypy/module/cpyext/sliceobject.py
--- a/pypy/module/cpyext/sliceobject.py
+++ b/pypy/module/cpyext/sliceobject.py
@@ -65,7 +65,7 @@
return W_SliceObject(w_start, w_stop, w_step)
@cpython_api([PySliceObject, Py_ssize_t, Py_ssize_tP, Py_ssize_tP, Py_ssize_tP,
- Py_ssize_tP], rffi.INT_real, error=-1)
+ Py_ssize_tP], rffi.INT, error=-1)
def PySlice_GetIndicesEx(space, w_slice, length, start_p, stop_p, step_p,
slicelength_p):
"""Usable replacement for PySlice_GetIndices(). Retrieve the start,
@@ -83,7 +83,7 @@
return 0
@cpython_api([PySliceObject, Py_ssize_t, Py_ssize_tP, Py_ssize_tP, Py_ssize_tP],
- rffi.INT_real, error=-1)
+ rffi.INT, error=-1)
def PySlice_GetIndices(space, w_slice, length, start_p, stop_p, step_p):
"""Retrieve the start, stop and step indices from the slice object slice,
assuming a sequence of length length. Treats indices greater than
diff --git a/pypy/module/cpyext/slotdefs.py b/pypy/module/cpyext/slotdefs.py
--- a/pypy/module/cpyext/slotdefs.py
+++ b/pypy/module/cpyext/slotdefs.py
@@ -194,7 +194,7 @@
args_w = space.fixedview(w_args)
other_w = args_w[0]
return generic_cpy_call(space, func_target,
- w_self, other_w, rffi.cast(rffi.INT_real, OP_CONST))
+ w_self, other_w, rffi.cast(rffi.INT, OP_CONST))
return inner
richcmp_eq = get_richcmp_func(Py_EQ)
@@ -211,7 +211,7 @@
w_args_new = space.newtuple(args_w)
return space.call(w_func, w_args_new, w_kwds)
- at cpython_api([PyObject, PyObject, PyObject], rffi.INT_real, error=-1, external=False)
+ at cpython_api([PyObject, PyObject, PyObject], rffi.INT, error=-1, external=False)
def slot_tp_init(space, w_self, w_args, w_kwds):
w_descr = space.lookup(w_self, '__init__')
args = Arguments.frompacked(space, w_args, w_kwds)
@@ -253,7 +253,7 @@
if setattr_fn is None:
return
- @cpython_api([PyObject, PyObject, PyObject], rffi.INT_real,
+ @cpython_api([PyObject, PyObject, PyObject], rffi.INT,
error=-1, external=True) # XXX should not be exported
@func_renamer("cpyext_tp_setattro_%s" % (typedef.name,))
def slot_tp_setattro(space, w_self, w_name, w_value):
diff --git a/pypy/module/cpyext/funcobject.py b/pypy/module/cpyext/funcobject.py
--- a/pypy/module/cpyext/funcobject.py
+++ b/pypy/module/cpyext/funcobject.py
@@ -65,7 +65,7 @@
assert isinstance(w_method, Method)
return borrow_from(w_method, w_method.w_class)
- at cpython_api([CONST_STRING, CONST_STRING, rffi.INT_real], PyObject)
+ at cpython_api([CONST_STRING, CONST_STRING, rffi.INT], PyObject)
def PyCode_NewEmpty(space, filename, funcname, firstlineno):
"""Creates a new empty code object with the specified source location."""
return space.wrap(PyCode(space,
diff --git a/pypy/module/cpyext/sysmodule.py b/pypy/module/cpyext/sysmodule.py
--- a/pypy/module/cpyext/sysmodule.py
+++ b/pypy/module/cpyext/sysmodule.py
@@ -12,7 +12,7 @@
w_obj = space.finditem_str(w_dict, name)
return borrow_from(None, w_obj)
- at cpython_api([CONST_STRING, PyObject], rffi.INT_real, error=-1)
+ at cpython_api([CONST_STRING, PyObject], rffi.INT, error=-1)
def PySys_SetObject(space, name, w_obj):
"""Set name in the sys module to v unless v is NULL, in which
case name is deleted from the sys module. Returns 0 on success, -1
diff --git a/pypy/module/cpyext/pystate.py b/pypy/module/cpyext/pystate.py
--- a/pypy/module/cpyext/pystate.py
+++ b/pypy/module/cpyext/pystate.py
@@ -30,7 +30,7 @@
def PyEval_InitThreads(space):
return
- at cpython_api([], rffi.INT_real, error=CANNOT_FAIL)
+ at cpython_api([], rffi.INT, error=CANNOT_FAIL)
def PyEval_ThreadsInitialized(space):
return 1
More information about the Pypy-commit
mailing list