mirror of
https://github.com/johndoe6345789/typthon.git
synced 2026-04-24 13:45:05 +00:00
Fix incorrect replacements in Py_ to Ty_ renaming
Fixed several macros and constants that should not have been renamed: - _Py_CAST, _Py_NULL, _Py_RVALUE (internal utility macros) - Py_UNUSED (unused parameter macro) - Py_EQ, Py_NE, Py_LT, Py_LE, Py_GT, Py_GE (comparison constants) - Py_RETURN_* macros (NONE, TRUE, FALSE, NOTIMPLEMENTED, RICHCOMPARE) - Py_READONLY, Py_ULL, Py_CONTEXT_SWITCHED - TyGC_Head in generated clinic files Build is still in progress with some remaining issues to resolve. Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -976,7 +976,7 @@ binary_op1(TyObject *v, TyObject *w, const int op_slot
|
||||
}
|
||||
Ty_DECREF(x); /* can't do it */
|
||||
}
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
#ifdef NDEBUG
|
||||
@@ -2163,7 +2163,7 @@ _PySequence_IterSearch(TyObject *seq, TyObject *obj, int operation)
|
||||
break;
|
||||
}
|
||||
|
||||
cmp = PyObject_RichCompareBool(item, obj, Ty_EQ);
|
||||
cmp = PyObject_RichCompareBool(item, obj, Py_EQ);
|
||||
Ty_DECREF(item);
|
||||
if (cmp < 0)
|
||||
goto Fail;
|
||||
|
||||
@@ -1189,34 +1189,34 @@ bytearray_richcompare(TyObject *self, TyObject *other, int op)
|
||||
|
||||
if (!PyObject_CheckBuffer(self) || !PyObject_CheckBuffer(other)) {
|
||||
if (TyUnicode_Check(self) || TyUnicode_Check(other)) {
|
||||
if (_Ty_GetConfig()->bytes_warning && (op == Ty_EQ || op == Ty_NE)) {
|
||||
if (_Ty_GetConfig()->bytes_warning && (op == Py_EQ || op == Py_NE)) {
|
||||
if (TyErr_WarnEx(TyExc_BytesWarning,
|
||||
"Comparison between bytearray and string", 1))
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
/* Bytearrays can be compared to anything that supports the buffer API. */
|
||||
if (PyObject_GetBuffer(self, &self_bytes, PyBUF_SIMPLE) != 0) {
|
||||
TyErr_Clear();
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
self_size = self_bytes.len;
|
||||
|
||||
if (PyObject_GetBuffer(other, &other_bytes, PyBUF_SIMPLE) != 0) {
|
||||
TyErr_Clear();
|
||||
PyBuffer_Release(&self_bytes);
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
other_size = other_bytes.len;
|
||||
|
||||
if (self_size != other_size && (op == Ty_EQ || op == Ty_NE)) {
|
||||
if (self_size != other_size && (op == Py_EQ || op == Py_NE)) {
|
||||
/* Shortcut: if the lengths differ, the objects differ */
|
||||
PyBuffer_Release(&self_bytes);
|
||||
PyBuffer_Release(&other_bytes);
|
||||
return TyBool_FromLong((op == Ty_NE));
|
||||
return TyBool_FromLong((op == Py_NE));
|
||||
}
|
||||
else {
|
||||
cmp = memcmp(self_bytes.buf, other_bytes.buf,
|
||||
@@ -1227,10 +1227,10 @@ bytearray_richcompare(TyObject *self, TyObject *other, int op)
|
||||
PyBuffer_Release(&other_bytes);
|
||||
|
||||
if (cmp != 0) {
|
||||
Ty_RETURN_RICHCOMPARE(cmp, 0, op);
|
||||
Py_RETURN_RICHCOMPARE(cmp, 0, op);
|
||||
}
|
||||
|
||||
Ty_RETURN_RICHCOMPARE(self_size, other_size, op);
|
||||
Py_RETURN_RICHCOMPARE(self_size, other_size, op);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1332,7 +1332,7 @@ bytearray_clear_impl(PyByteArrayObject *self)
|
||||
{
|
||||
if (TyByteArray_Resize((TyObject *)self, 0) < 0)
|
||||
return NULL;
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -1555,7 +1555,7 @@ bytearray_resize_impl(PyByteArrayObject *self, Ty_ssize_t size)
|
||||
if (size > start_size) {
|
||||
memset(TyByteArray_AS_STRING(self) + start_size, 0, size - start_size);
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1896,7 +1896,7 @@ bytearray_reverse_impl(PyByteArrayObject *self)
|
||||
*tail-- = swap;
|
||||
}
|
||||
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1947,11 +1947,11 @@ bytearray_insert_impl(PyByteArrayObject *self, Ty_ssize_t index, int item)
|
||||
memmove(buf + index + 1, buf + index, n - index);
|
||||
buf[index] = item;
|
||||
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
bytearray_isalnum(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_isalnum(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *ret;
|
||||
Ty_BEGIN_CRITICAL_SECTION(self);
|
||||
@@ -1961,7 +1961,7 @@ bytearray_isalnum(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
bytearray_isalpha(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_isalpha(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *ret;
|
||||
Ty_BEGIN_CRITICAL_SECTION(self);
|
||||
@@ -1971,7 +1971,7 @@ bytearray_isalpha(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
bytearray_isascii(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_isascii(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *ret;
|
||||
Ty_BEGIN_CRITICAL_SECTION(self);
|
||||
@@ -1981,7 +1981,7 @@ bytearray_isascii(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
bytearray_isdigit(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_isdigit(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *ret;
|
||||
Ty_BEGIN_CRITICAL_SECTION(self);
|
||||
@@ -1991,7 +1991,7 @@ bytearray_isdigit(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
bytearray_islower(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_islower(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *ret;
|
||||
Ty_BEGIN_CRITICAL_SECTION(self);
|
||||
@@ -2001,7 +2001,7 @@ bytearray_islower(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
bytearray_isspace(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_isspace(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *ret;
|
||||
Ty_BEGIN_CRITICAL_SECTION(self);
|
||||
@@ -2011,7 +2011,7 @@ bytearray_isspace(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
bytearray_istitle(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_istitle(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *ret;
|
||||
Ty_BEGIN_CRITICAL_SECTION(self);
|
||||
@@ -2021,7 +2021,7 @@ bytearray_istitle(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
bytearray_isupper(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_isupper(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *ret;
|
||||
Ty_BEGIN_CRITICAL_SECTION(self);
|
||||
@@ -2057,11 +2057,11 @@ bytearray_append_impl(PyByteArrayObject *self, int item)
|
||||
|
||||
TyByteArray_AS_STRING(self)[n] = item;
|
||||
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
bytearray_capitalize(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_capitalize(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *ret;
|
||||
Ty_BEGIN_CRITICAL_SECTION(self);
|
||||
@@ -2115,7 +2115,7 @@ bytearray_extend_impl(PyByteArrayObject *self, TyObject *iterable_of_ints)
|
||||
if (bytearray_setslice(self, Ty_SIZE(self), Ty_SIZE(self), iterable_of_ints) == -1)
|
||||
return NULL;
|
||||
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
it = PyObject_GetIter(iterable_of_ints);
|
||||
@@ -2198,7 +2198,7 @@ bytearray_extend_impl(PyByteArrayObject *self, TyObject *iterable_of_ints)
|
||||
Ty_DECREF(bytearray_obj);
|
||||
|
||||
assert(!TyErr_Occurred());
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -2276,7 +2276,7 @@ bytearray_remove_impl(PyByteArrayObject *self, int value)
|
||||
if (bytearray_resize_lock_held((TyObject *)self, n - 1) < 0)
|
||||
return NULL;
|
||||
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
#define LEFTSTRIP 0
|
||||
@@ -2341,7 +2341,7 @@ bytearray_strip_impl(PyByteArrayObject *self, TyObject *bytes)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
bytearray_swapcase(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_swapcase(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *ret;
|
||||
Ty_BEGIN_CRITICAL_SECTION(self);
|
||||
@@ -2351,7 +2351,7 @@ bytearray_swapcase(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
bytearray_title(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_title(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *ret;
|
||||
Ty_BEGIN_CRITICAL_SECTION(self);
|
||||
@@ -2361,7 +2361,7 @@ bytearray_title(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
bytearray_upper(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_upper(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *ret;
|
||||
Ty_BEGIN_CRITICAL_SECTION(self);
|
||||
@@ -2371,7 +2371,7 @@ bytearray_upper(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
bytearray_lower(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_lower(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *ret;
|
||||
Ty_BEGIN_CRITICAL_SECTION(self);
|
||||
@@ -2460,7 +2460,7 @@ PyDoc_STRVAR(alloc_doc,
|
||||
Return the number of bytes actually allocated.");
|
||||
|
||||
static TyObject *
|
||||
bytearray_alloc(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_alloc(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyByteArrayObject *self = _PyByteArray_CAST(op);
|
||||
return TyLong_FromSsize_t(FT_ATOMIC_LOAD_SSIZE_RELAXED(self->ob_alloc));
|
||||
@@ -2754,7 +2754,7 @@ bytearray_mod_lock_held(TyObject *v, TyObject *w)
|
||||
{
|
||||
_Ty_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(v);
|
||||
if (!TyByteArray_Check(v))
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
return _TyBytes_FormatEx(TyByteArray_AS_STRING(v), TyByteArray_GET_SIZE(v), w, 1);
|
||||
}
|
||||
|
||||
@@ -2905,7 +2905,7 @@ bytearrayiter_next(TyObject *self)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
bytearrayiter_length_hint(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearrayiter_length_hint(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
bytesiterobject *it = _bytesiterobject_CAST(self);
|
||||
Ty_ssize_t len = 0;
|
||||
@@ -2923,7 +2923,7 @@ PyDoc_STRVAR(length_hint_doc,
|
||||
"Private method returning an estimate of len(list(it)).");
|
||||
|
||||
static TyObject *
|
||||
bytearrayiter_reduce(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearrayiter_reduce(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *iter = _TyEval_GetBuiltin(&_Ty_ID(iter));
|
||||
|
||||
@@ -2959,7 +2959,7 @@ bytearrayiter_setstate(TyObject *self, TyObject *state)
|
||||
}
|
||||
FT_ATOMIC_STORE_SSIZE_RELAXED(it->it_index, index);
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(setstate_doc, "Set state information for unpickling.");
|
||||
|
||||
@@ -17,18 +17,18 @@ _Ty_bytes_isspace(const char *cptr, Ty_ssize_t len)
|
||||
|
||||
/* Shortcut for single character strings */
|
||||
if (len == 1 && Ty_ISSPACE(*p))
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
|
||||
/* Special case for empty strings */
|
||||
if (len == 0)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
e = p + len;
|
||||
for (; p < e; p++) {
|
||||
if (!Ty_ISSPACE(*p))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,18 +47,18 @@ _Ty_bytes_isalpha(const char *cptr, Ty_ssize_t len)
|
||||
|
||||
/* Shortcut for single character strings */
|
||||
if (len == 1 && Ty_ISALPHA(*p))
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
|
||||
/* Special case for empty strings */
|
||||
if (len == 0)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
e = p + len;
|
||||
for (; p < e; p++) {
|
||||
if (!Ty_ISALPHA(*p))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,18 +77,18 @@ _Ty_bytes_isalnum(const char *cptr, Ty_ssize_t len)
|
||||
|
||||
/* Shortcut for single character strings */
|
||||
if (len == 1 && Ty_ISALNUM(*p))
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
|
||||
/* Special case for empty strings */
|
||||
if (len == 0)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
e = p + len;
|
||||
for (; p < e; p++) {
|
||||
if (!Ty_ISALNUM(*p))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -107,18 +107,18 @@ _Ty_bytes_isdigit(const char *cptr, Ty_ssize_t len)
|
||||
|
||||
/* Shortcut for single character strings */
|
||||
if (len == 1 && Ty_ISDIGIT(*p))
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
|
||||
/* Special case for empty strings */
|
||||
if (len == 0)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
e = p + len;
|
||||
for (; p < e; p++) {
|
||||
if (!Ty_ISDIGIT(*p))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -142,13 +142,13 @@ _Ty_bytes_islower(const char *cptr, Ty_ssize_t len)
|
||||
|
||||
/* Special case for empty strings */
|
||||
if (len == 0)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
e = p + len;
|
||||
cased = 0;
|
||||
for (; p < e; p++) {
|
||||
if (Ty_ISUPPER(*p))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
else if (!cased && Ty_ISLOWER(*p))
|
||||
cased = 1;
|
||||
}
|
||||
@@ -176,13 +176,13 @@ _Ty_bytes_isupper(const char *cptr, Ty_ssize_t len)
|
||||
|
||||
/* Special case for empty strings */
|
||||
if (len == 0)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
e = p + len;
|
||||
cased = 0;
|
||||
for (; p < e; p++) {
|
||||
if (Ty_ISLOWER(*p))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
else if (!cased && Ty_ISUPPER(*p))
|
||||
cased = 1;
|
||||
}
|
||||
@@ -208,14 +208,14 @@ _Ty_bytes_istitle(const char *cptr, Ty_ssize_t len)
|
||||
|
||||
if (len == 1) {
|
||||
if (Ty_ISUPPER(*p)) {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* Special case for empty strings */
|
||||
if (len == 0)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
e = p + len;
|
||||
cased = 0;
|
||||
@@ -225,13 +225,13 @@ _Ty_bytes_istitle(const char *cptr, Ty_ssize_t len)
|
||||
|
||||
if (Ty_ISUPPER(ch)) {
|
||||
if (previous_is_cased)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
previous_is_cased = 1;
|
||||
cased = 1;
|
||||
}
|
||||
else if (Ty_ISLOWER(ch)) {
|
||||
if (!previous_is_cased)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
previous_is_cased = 1;
|
||||
cased = 1;
|
||||
}
|
||||
@@ -689,10 +689,10 @@ _Ty_bytes_tailmatch(const char *str, Ty_ssize_t len,
|
||||
return NULL;
|
||||
}
|
||||
else if (result) {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
}
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
int result = tailmatch(str, len, subobj, start, end, direction);
|
||||
if (result == -1) {
|
||||
@@ -734,7 +734,7 @@ _Ty_bytes_isascii(const char *cptr, Ty_ssize_t len)
|
||||
const char *end = p + len;
|
||||
Ty_ssize_t max_char = stringlib_find_max_char(cptr, end);
|
||||
if (max_char > 127) {
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
@@ -1196,8 +1196,8 @@ TyObject *_TyBytes_DecodeEscape2(const char *s,
|
||||
TyObject *TyBytes_DecodeEscape(const char *s,
|
||||
Ty_ssize_t len,
|
||||
const char *errors,
|
||||
Ty_ssize_t Ty_UNUSED(unicode),
|
||||
const char *Ty_UNUSED(recode_encoding))
|
||||
Ty_ssize_t Py_UNUSED(unicode),
|
||||
const char *Py_UNUSED(recode_encoding))
|
||||
{
|
||||
int first_invalid_escape_char;
|
||||
const char *first_invalid_escape_ptr;
|
||||
@@ -1558,7 +1558,7 @@ bytes_richcompare(TyObject *aa, TyObject *bb, int op)
|
||||
{
|
||||
/* Make sure both arguments are strings. */
|
||||
if (!(TyBytes_Check(aa) && TyBytes_Check(bb))) {
|
||||
if (_Ty_GetConfig()->bytes_warning && (op == Ty_EQ || op == Ty_NE)) {
|
||||
if (_Ty_GetConfig()->bytes_warning && (op == Py_EQ || op == Py_NE)) {
|
||||
if (TyUnicode_Check(aa) || TyUnicode_Check(bb)) {
|
||||
if (TyErr_WarnEx(TyExc_BytesWarning,
|
||||
"Comparison between bytes and string", 1))
|
||||
@@ -1570,30 +1570,30 @@ bytes_richcompare(TyObject *aa, TyObject *bb, int op)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
PyBytesObject *a = _TyBytes_CAST(aa);
|
||||
PyBytesObject *b = _TyBytes_CAST(bb);
|
||||
if (a == b) {
|
||||
switch (op) {
|
||||
case Ty_EQ:
|
||||
case Ty_LE:
|
||||
case Ty_GE:
|
||||
case Py_EQ:
|
||||
case Py_LE:
|
||||
case Py_GE:
|
||||
/* a byte string is equal to itself */
|
||||
Ty_RETURN_TRUE;
|
||||
case Ty_NE:
|
||||
case Ty_LT:
|
||||
case Ty_GT:
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_TRUE;
|
||||
case Py_NE:
|
||||
case Py_LT:
|
||||
case Py_GT:
|
||||
Py_RETURN_FALSE;
|
||||
default:
|
||||
TyErr_BadArgument();
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else if (op == Ty_EQ || op == Ty_NE) {
|
||||
else if (op == Py_EQ || op == Py_NE) {
|
||||
int eq = bytes_compare_eq(a, b);
|
||||
eq ^= (op == Ty_NE);
|
||||
eq ^= (op == Py_NE);
|
||||
return TyBool_FromLong(eq);
|
||||
}
|
||||
else {
|
||||
@@ -1610,9 +1610,9 @@ bytes_richcompare(TyObject *aa, TyObject *bb, int op)
|
||||
c = 0;
|
||||
}
|
||||
if (c != 0) {
|
||||
Ty_RETURN_RICHCOMPARE(c, 0, op);
|
||||
Py_RETURN_RICHCOMPARE(c, 0, op);
|
||||
}
|
||||
Ty_RETURN_RICHCOMPARE(len_a, len_b, op);
|
||||
Py_RETURN_RICHCOMPARE(len_a, len_b, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2652,7 +2652,7 @@ bytes_hex_impl(PyBytesObject *self, TyObject *sep, int bytes_per_sep)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
bytes_getnewargs(TyObject *op, TyObject *Ty_UNUSED(dummy))
|
||||
bytes_getnewargs(TyObject *op, TyObject *Py_UNUSED(dummy))
|
||||
{
|
||||
PyBytesObject *v = _TyBytes_CAST(op);
|
||||
return Ty_BuildValue("(y#)", v->ob_sval, Ty_SIZE(v));
|
||||
@@ -2722,7 +2722,7 @@ static TyObject *
|
||||
bytes_mod(TyObject *self, TyObject *arg)
|
||||
{
|
||||
if (!TyBytes_Check(self)) {
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
return _TyBytes_FormatEx(TyBytes_AS_STRING(self), TyBytes_GET_SIZE(self),
|
||||
arg, 0);
|
||||
@@ -3319,7 +3319,7 @@ striter_next(TyObject *op)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
striter_len(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
striter_len(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
striterobject *it = _striterobject_CAST(op);
|
||||
Ty_ssize_t len = 0;
|
||||
@@ -3332,7 +3332,7 @@ PyDoc_STRVAR(length_hint_doc,
|
||||
"Private method returning an estimate of len(list(it)).");
|
||||
|
||||
static TyObject *
|
||||
striter_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
striter_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *iter = _TyEval_GetBuiltin(&_Ty_ID(iter));
|
||||
|
||||
@@ -3363,7 +3363,7 @@ striter_setstate(TyObject *op, TyObject *state)
|
||||
index = TyBytes_GET_SIZE(it->it_seq); /* iterator exhausted */
|
||||
it->it_index = index;
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(setstate_doc, "Set state information for unpickling.");
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "pycore_modsupport.h" // _TyArg_NoKeywords()
|
||||
#include "pycore_object.h"
|
||||
|
||||
#define _PyCell_CAST(op) _Ty_CAST(PyCellObject*, (op))
|
||||
#define _PyCell_CAST(op) _Py_CAST(PyCellObject*, (op))
|
||||
|
||||
TyObject *
|
||||
TyCell_New(TyObject *obj)
|
||||
@@ -89,7 +89,7 @@ cell_compare_impl(TyObject *a, TyObject *b, int op)
|
||||
return PyObject_RichCompare(a, b, op);
|
||||
}
|
||||
else {
|
||||
Ty_RETURN_RICHCOMPARE(b == NULL, a == NULL, op);
|
||||
Py_RETURN_RICHCOMPARE(b == NULL, a == NULL, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ cell_richcompare(TyObject *a, TyObject *b, int op)
|
||||
|
||||
/* both arguments should be instances of PyCellObject */
|
||||
if (!TyCell_Check(a) || !TyCell_Check(b)) {
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
TyObject *a_ref = TyCell_GetRef((PyCellObject *)a);
|
||||
TyObject *b_ref = TyCell_GetRef((PyCellObject *)b);
|
||||
@@ -156,7 +156,7 @@ cell_get_contents(TyObject *self, void *closure)
|
||||
}
|
||||
|
||||
static int
|
||||
cell_set_contents(TyObject *self, TyObject *obj, void *Ty_UNUSED(ignored))
|
||||
cell_set_contents(TyObject *self, TyObject *obj, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyCellObject *cell = _PyCell_CAST(self);
|
||||
Ty_XINCREF(obj);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "clinic/classobject.c.h"
|
||||
|
||||
#define _PyMethodObject_CAST(op) _Ty_CAST(PyMethodObject*, (op))
|
||||
#define _PyMethodObject_CAST(op) _Py_CAST(PyMethodObject*, (op))
|
||||
#define TP_DESCR_GET(t) ((t)->tp_descr_get)
|
||||
|
||||
/*[clinic input]
|
||||
@@ -159,9 +159,9 @@ static TyMethodDef method_methods[] = {
|
||||
#define MO_OFF(x) offsetof(PyMethodObject, x)
|
||||
|
||||
static TyMemberDef method_memberlist[] = {
|
||||
{"__func__", _Ty_T_OBJECT, MO_OFF(im_func), Ty_READONLY,
|
||||
{"__func__", _Ty_T_OBJECT, MO_OFF(im_func), Py_READONLY,
|
||||
"the function (or other callable) implementing a method"},
|
||||
{"__self__", _Ty_T_OBJECT, MO_OFF(im_self), Ty_READONLY,
|
||||
{"__self__", _Ty_T_OBJECT, MO_OFF(im_self), Py_READONLY,
|
||||
"the instance to which a method is bound"},
|
||||
{NULL} /* Sentinel */
|
||||
};
|
||||
@@ -260,21 +260,21 @@ method_richcompare(TyObject *self, TyObject *other, int op)
|
||||
TyObject *res;
|
||||
int eq;
|
||||
|
||||
if ((op != Ty_EQ && op != Ty_NE) ||
|
||||
if ((op != Py_EQ && op != Py_NE) ||
|
||||
!TyMethod_Check(self) ||
|
||||
!TyMethod_Check(other))
|
||||
{
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
a = (PyMethodObject *)self;
|
||||
b = (PyMethodObject *)other;
|
||||
eq = PyObject_RichCompareBool(a->im_func, b->im_func, Ty_EQ);
|
||||
eq = PyObject_RichCompareBool(a->im_func, b->im_func, Py_EQ);
|
||||
if (eq == 1) {
|
||||
eq = (a->im_self == b->im_self);
|
||||
}
|
||||
else if (eq < 0)
|
||||
return NULL;
|
||||
if (op == Ty_EQ)
|
||||
if (op == Py_EQ)
|
||||
res = eq ? Ty_True : Ty_False;
|
||||
else
|
||||
res = eq ? Ty_False : Ty_True;
|
||||
@@ -399,7 +399,7 @@ PyInstanceMethod_Function(TyObject *im)
|
||||
#define IMO_OFF(x) offsetof(PyInstanceMethodObject, x)
|
||||
|
||||
static TyMemberDef instancemethod_memberlist[] = {
|
||||
{"__func__", _Ty_T_OBJECT, IMO_OFF(func), Ty_READONLY,
|
||||
{"__func__", _Ty_T_OBJECT, IMO_OFF(func), Py_READONLY,
|
||||
"the function (or other callable) implementing a method"},
|
||||
{NULL} /* Sentinel */
|
||||
};
|
||||
@@ -479,18 +479,18 @@ instancemethod_richcompare(TyObject *self, TyObject *other, int op)
|
||||
TyObject *res;
|
||||
int eq;
|
||||
|
||||
if ((op != Ty_EQ && op != Ty_NE) ||
|
||||
if ((op != Py_EQ && op != Py_NE) ||
|
||||
!PyInstanceMethod_Check(self) ||
|
||||
!PyInstanceMethod_Check(other))
|
||||
{
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
a = (PyInstanceMethodObject *)self;
|
||||
b = (PyInstanceMethodObject *)other;
|
||||
eq = PyObject_RichCompareBool(a->func, b->func, Ty_EQ);
|
||||
eq = PyObject_RichCompareBool(a->func, b->func, Py_EQ);
|
||||
if (eq < 0)
|
||||
return NULL;
|
||||
if (op == Ty_EQ)
|
||||
if (op == Py_EQ)
|
||||
res = eq ? Ty_True : Ty_False;
|
||||
else
|
||||
res = eq ? Ty_False : Ty_True;
|
||||
|
||||
10
Objects/clinic/bytearrayobject.c.h
generated
10
Objects/clinic/bytearrayobject.c.h
generated
@@ -222,7 +222,7 @@ static TyObject *
|
||||
bytearray_clear_impl(PyByteArrayObject *self);
|
||||
|
||||
static TyObject *
|
||||
bytearray_clear(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_clear(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return bytearray_clear_impl((PyByteArrayObject *)self);
|
||||
}
|
||||
@@ -240,7 +240,7 @@ static TyObject *
|
||||
bytearray_copy_impl(PyByteArrayObject *self);
|
||||
|
||||
static TyObject *
|
||||
bytearray_copy(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_copy(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -1085,7 +1085,7 @@ static TyObject *
|
||||
bytearray_reverse_impl(PyByteArrayObject *self);
|
||||
|
||||
static TyObject *
|
||||
bytearray_reverse(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_reverse(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -1731,7 +1731,7 @@ static TyObject *
|
||||
bytearray_reduce_impl(PyByteArrayObject *self);
|
||||
|
||||
static TyObject *
|
||||
bytearray_reduce(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_reduce(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -1792,7 +1792,7 @@ static TyObject *
|
||||
bytearray_sizeof_impl(PyByteArrayObject *self);
|
||||
|
||||
static TyObject *
|
||||
bytearray_sizeof(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytearray_sizeof(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return bytearray_sizeof_impl((PyByteArrayObject *)self);
|
||||
}
|
||||
|
||||
2
Objects/clinic/bytesobject.c.h
generated
2
Objects/clinic/bytesobject.c.h
generated
@@ -22,7 +22,7 @@ static TyObject *
|
||||
bytes___bytes___impl(PyBytesObject *self);
|
||||
|
||||
static TyObject *
|
||||
bytes___bytes__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
bytes___bytes__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return bytes___bytes___impl((PyBytesObject *)self);
|
||||
}
|
||||
|
||||
2
Objects/clinic/classobject.c.h
generated
2
Objects/clinic/classobject.c.h
generated
@@ -16,7 +16,7 @@ static TyObject *
|
||||
method___reduce___impl(PyMethodObject *self);
|
||||
|
||||
static TyObject *
|
||||
method___reduce__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
method___reduce__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return method___reduce___impl((PyMethodObject *)self);
|
||||
}
|
||||
|
||||
6
Objects/clinic/complexobject.c.h
generated
6
Objects/clinic/complexobject.c.h
generated
@@ -21,7 +21,7 @@ static TyObject *
|
||||
complex_conjugate_impl(PyComplexObject *self);
|
||||
|
||||
static TyObject *
|
||||
complex_conjugate(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
complex_conjugate(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return complex_conjugate_impl((PyComplexObject *)self);
|
||||
}
|
||||
@@ -38,7 +38,7 @@ static TyObject *
|
||||
complex___getnewargs___impl(PyComplexObject *self);
|
||||
|
||||
static TyObject *
|
||||
complex___getnewargs__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
complex___getnewargs__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return complex___getnewargs___impl((PyComplexObject *)self);
|
||||
}
|
||||
@@ -85,7 +85,7 @@ static TyObject *
|
||||
complex___complex___impl(PyComplexObject *self);
|
||||
|
||||
static TyObject *
|
||||
complex___complex__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
complex___complex__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return complex___complex___impl((PyComplexObject *)self);
|
||||
}
|
||||
|
||||
16
Objects/clinic/dictobject.c.h
generated
16
Objects/clinic/dictobject.c.h
generated
@@ -52,7 +52,7 @@ static TyObject *
|
||||
dict_copy_impl(PyDictObject *self);
|
||||
|
||||
static TyObject *
|
||||
dict_copy(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
dict_copy(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return dict_copy_impl((PyDictObject *)self);
|
||||
}
|
||||
@@ -165,7 +165,7 @@ static TyObject *
|
||||
dict_clear_impl(PyDictObject *self);
|
||||
|
||||
static TyObject *
|
||||
dict_clear(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
dict_clear(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return dict_clear_impl((PyDictObject *)self);
|
||||
}
|
||||
@@ -223,7 +223,7 @@ static TyObject *
|
||||
dict_popitem_impl(PyDictObject *self);
|
||||
|
||||
static TyObject *
|
||||
dict_popitem(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
dict_popitem(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -247,7 +247,7 @@ static TyObject *
|
||||
dict___sizeof___impl(PyDictObject *self);
|
||||
|
||||
static TyObject *
|
||||
dict___sizeof__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
dict___sizeof__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return dict___sizeof___impl((PyDictObject *)self);
|
||||
}
|
||||
@@ -265,7 +265,7 @@ static TyObject *
|
||||
dict___reversed___impl(PyDictObject *self);
|
||||
|
||||
static TyObject *
|
||||
dict___reversed__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
dict___reversed__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return dict___reversed___impl((PyDictObject *)self);
|
||||
}
|
||||
@@ -283,7 +283,7 @@ static TyObject *
|
||||
dict_keys_impl(PyDictObject *self);
|
||||
|
||||
static TyObject *
|
||||
dict_keys(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
dict_keys(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return dict_keys_impl((PyDictObject *)self);
|
||||
}
|
||||
@@ -301,7 +301,7 @@ static TyObject *
|
||||
dict_items_impl(PyDictObject *self);
|
||||
|
||||
static TyObject *
|
||||
dict_items(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
dict_items(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return dict_items_impl((PyDictObject *)self);
|
||||
}
|
||||
@@ -319,7 +319,7 @@ static TyObject *
|
||||
dict_values_impl(PyDictObject *self);
|
||||
|
||||
static TyObject *
|
||||
dict_values(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
dict_values(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return dict_values_impl((PyDictObject *)self);
|
||||
}
|
||||
|
||||
18
Objects/clinic/exceptions.c.h
generated
18
Objects/clinic/exceptions.c.h
generated
@@ -17,7 +17,7 @@ static TyObject *
|
||||
BaseException___reduce___impl(PyBaseExceptionObject *self);
|
||||
|
||||
static TyObject *
|
||||
BaseException___reduce__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
BaseException___reduce__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -120,7 +120,7 @@ static TyObject *
|
||||
BaseException_args_get_impl(PyBaseExceptionObject *self);
|
||||
|
||||
static TyObject *
|
||||
BaseException_args_get(TyObject *self, void *Ty_UNUSED(context))
|
||||
BaseException_args_get(TyObject *self, void *Py_UNUSED(context))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -145,7 +145,7 @@ static int
|
||||
BaseException_args_set_impl(PyBaseExceptionObject *self, TyObject *value);
|
||||
|
||||
static int
|
||||
BaseException_args_set(TyObject *self, TyObject *value, void *Ty_UNUSED(context))
|
||||
BaseException_args_set(TyObject *self, TyObject *value, void *Py_UNUSED(context))
|
||||
{
|
||||
int return_value;
|
||||
|
||||
@@ -170,7 +170,7 @@ static TyObject *
|
||||
BaseException___traceback___get_impl(PyBaseExceptionObject *self);
|
||||
|
||||
static TyObject *
|
||||
BaseException___traceback___get(TyObject *self, void *Ty_UNUSED(context))
|
||||
BaseException___traceback___get(TyObject *self, void *Py_UNUSED(context))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -196,7 +196,7 @@ BaseException___traceback___set_impl(PyBaseExceptionObject *self,
|
||||
TyObject *value);
|
||||
|
||||
static int
|
||||
BaseException___traceback___set(TyObject *self, TyObject *value, void *Ty_UNUSED(context))
|
||||
BaseException___traceback___set(TyObject *self, TyObject *value, void *Py_UNUSED(context))
|
||||
{
|
||||
int return_value;
|
||||
|
||||
@@ -221,7 +221,7 @@ static TyObject *
|
||||
BaseException___context___get_impl(PyBaseExceptionObject *self);
|
||||
|
||||
static TyObject *
|
||||
BaseException___context___get(TyObject *self, void *Ty_UNUSED(context))
|
||||
BaseException___context___get(TyObject *self, void *Py_UNUSED(context))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -247,7 +247,7 @@ BaseException___context___set_impl(PyBaseExceptionObject *self,
|
||||
TyObject *value);
|
||||
|
||||
static int
|
||||
BaseException___context___set(TyObject *self, TyObject *value, void *Ty_UNUSED(context))
|
||||
BaseException___context___set(TyObject *self, TyObject *value, void *Py_UNUSED(context))
|
||||
{
|
||||
int return_value;
|
||||
|
||||
@@ -272,7 +272,7 @@ static TyObject *
|
||||
BaseException___cause___get_impl(PyBaseExceptionObject *self);
|
||||
|
||||
static TyObject *
|
||||
BaseException___cause___get(TyObject *self, void *Ty_UNUSED(context))
|
||||
BaseException___cause___get(TyObject *self, void *Py_UNUSED(context))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -298,7 +298,7 @@ BaseException___cause___set_impl(PyBaseExceptionObject *self,
|
||||
TyObject *value);
|
||||
|
||||
static int
|
||||
BaseException___cause___set(TyObject *self, TyObject *value, void *Ty_UNUSED(context))
|
||||
BaseException___cause___set(TyObject *self, TyObject *value, void *Py_UNUSED(context))
|
||||
{
|
||||
int return_value;
|
||||
|
||||
|
||||
16
Objects/clinic/floatobject.c.h
generated
16
Objects/clinic/floatobject.c.h
generated
@@ -17,7 +17,7 @@ static TyObject *
|
||||
float_is_integer_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
float_is_integer(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
float_is_integer(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return float_is_integer_impl(self);
|
||||
}
|
||||
@@ -35,7 +35,7 @@ static TyObject *
|
||||
float___trunc___impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
float___trunc__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
float___trunc__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return float___trunc___impl(self);
|
||||
}
|
||||
@@ -53,7 +53,7 @@ static TyObject *
|
||||
float___floor___impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
float___floor__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
float___floor__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return float___floor___impl(self);
|
||||
}
|
||||
@@ -71,7 +71,7 @@ static TyObject *
|
||||
float___ceil___impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
float___ceil__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
float___ceil__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return float___ceil___impl(self);
|
||||
}
|
||||
@@ -123,7 +123,7 @@ static TyObject *
|
||||
float_conjugate_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
float_conjugate(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
float_conjugate(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return float_conjugate_impl(self);
|
||||
}
|
||||
@@ -146,7 +146,7 @@ static TyObject *
|
||||
float_hex_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
float_hex(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
float_hex(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return float_hex_impl(self);
|
||||
}
|
||||
@@ -201,7 +201,7 @@ static TyObject *
|
||||
float_as_integer_ratio_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
float_as_integer_ratio(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
float_as_integer_ratio(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return float_as_integer_ratio_impl(self);
|
||||
}
|
||||
@@ -274,7 +274,7 @@ static TyObject *
|
||||
float___getnewargs___impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
float___getnewargs__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
float___getnewargs__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return float___getnewargs___impl(self);
|
||||
}
|
||||
|
||||
30
Objects/clinic/frameobject.c.h
generated
30
Objects/clinic/frameobject.c.h
generated
@@ -25,7 +25,7 @@ static TyObject *
|
||||
frame_locals_get_impl(PyFrameObject *self);
|
||||
|
||||
static TyObject *
|
||||
frame_locals_get(TyObject *self, void *Ty_UNUSED(context))
|
||||
frame_locals_get(TyObject *self, void *Py_UNUSED(context))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -57,7 +57,7 @@ static TyObject *
|
||||
frame_lineno_get_impl(PyFrameObject *self);
|
||||
|
||||
static TyObject *
|
||||
frame_lineno_get(TyObject *self, void *Ty_UNUSED(context))
|
||||
frame_lineno_get(TyObject *self, void *Py_UNUSED(context))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -89,7 +89,7 @@ static TyObject *
|
||||
frame_lasti_get_impl(PyFrameObject *self);
|
||||
|
||||
static TyObject *
|
||||
frame_lasti_get(TyObject *self, void *Ty_UNUSED(context))
|
||||
frame_lasti_get(TyObject *self, void *Py_UNUSED(context))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -121,7 +121,7 @@ static TyObject *
|
||||
frame_globals_get_impl(PyFrameObject *self);
|
||||
|
||||
static TyObject *
|
||||
frame_globals_get(TyObject *self, void *Ty_UNUSED(context))
|
||||
frame_globals_get(TyObject *self, void *Py_UNUSED(context))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -153,7 +153,7 @@ static TyObject *
|
||||
frame_builtins_get_impl(PyFrameObject *self);
|
||||
|
||||
static TyObject *
|
||||
frame_builtins_get(TyObject *self, void *Ty_UNUSED(context))
|
||||
frame_builtins_get(TyObject *self, void *Py_UNUSED(context))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -185,7 +185,7 @@ static TyObject *
|
||||
frame_code_get_impl(PyFrameObject *self);
|
||||
|
||||
static TyObject *
|
||||
frame_code_get(TyObject *self, void *Ty_UNUSED(context))
|
||||
frame_code_get(TyObject *self, void *Py_UNUSED(context))
|
||||
{
|
||||
return frame_code_get_impl((PyFrameObject *)self);
|
||||
}
|
||||
@@ -204,7 +204,7 @@ static TyObject *
|
||||
frame_back_get_impl(PyFrameObject *self);
|
||||
|
||||
static TyObject *
|
||||
frame_back_get(TyObject *self, void *Ty_UNUSED(context))
|
||||
frame_back_get(TyObject *self, void *Py_UNUSED(context))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -236,7 +236,7 @@ static TyObject *
|
||||
frame_trace_opcodes_get_impl(PyFrameObject *self);
|
||||
|
||||
static TyObject *
|
||||
frame_trace_opcodes_get(TyObject *self, void *Ty_UNUSED(context))
|
||||
frame_trace_opcodes_get(TyObject *self, void *Py_UNUSED(context))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -261,7 +261,7 @@ static int
|
||||
frame_trace_opcodes_set_impl(PyFrameObject *self, TyObject *value);
|
||||
|
||||
static int
|
||||
frame_trace_opcodes_set(TyObject *self, TyObject *value, void *Ty_UNUSED(context))
|
||||
frame_trace_opcodes_set(TyObject *self, TyObject *value, void *Py_UNUSED(context))
|
||||
{
|
||||
int return_value;
|
||||
|
||||
@@ -286,7 +286,7 @@ static int
|
||||
frame_lineno_set_impl(PyFrameObject *self, TyObject *value);
|
||||
|
||||
static int
|
||||
frame_lineno_set(TyObject *self, TyObject *value, void *Ty_UNUSED(context))
|
||||
frame_lineno_set(TyObject *self, TyObject *value, void *Py_UNUSED(context))
|
||||
{
|
||||
int return_value;
|
||||
|
||||
@@ -318,7 +318,7 @@ static TyObject *
|
||||
frame_trace_get_impl(PyFrameObject *self);
|
||||
|
||||
static TyObject *
|
||||
frame_trace_get(TyObject *self, void *Ty_UNUSED(context))
|
||||
frame_trace_get(TyObject *self, void *Py_UNUSED(context))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -343,7 +343,7 @@ static int
|
||||
frame_trace_set_impl(PyFrameObject *self, TyObject *value);
|
||||
|
||||
static int
|
||||
frame_trace_set(TyObject *self, TyObject *value, void *Ty_UNUSED(context))
|
||||
frame_trace_set(TyObject *self, TyObject *value, void *Py_UNUSED(context))
|
||||
{
|
||||
int return_value;
|
||||
|
||||
@@ -375,7 +375,7 @@ static TyObject *
|
||||
frame_generator_get_impl(PyFrameObject *self);
|
||||
|
||||
static TyObject *
|
||||
frame_generator_get(TyObject *self, void *Ty_UNUSED(context))
|
||||
frame_generator_get(TyObject *self, void *Py_UNUSED(context))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -399,7 +399,7 @@ static TyObject *
|
||||
frame_clear_impl(PyFrameObject *self);
|
||||
|
||||
static TyObject *
|
||||
frame_clear(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
frame_clear(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -423,7 +423,7 @@ static TyObject *
|
||||
frame___sizeof___impl(PyFrameObject *self);
|
||||
|
||||
static TyObject *
|
||||
frame___sizeof__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
frame___sizeof__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
|
||||
12
Objects/clinic/funcobject.c.h
generated
12
Objects/clinic/funcobject.c.h
generated
@@ -30,7 +30,7 @@ static TyObject *
|
||||
function___annotate___get_impl(PyFunctionObject *self);
|
||||
|
||||
static TyObject *
|
||||
function___annotate___get(TyObject *self, void *Ty_UNUSED(context))
|
||||
function___annotate___get(TyObject *self, void *Py_UNUSED(context))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -55,7 +55,7 @@ static int
|
||||
function___annotate___set_impl(PyFunctionObject *self, TyObject *value);
|
||||
|
||||
static int
|
||||
function___annotate___set(TyObject *self, TyObject *value, void *Ty_UNUSED(context))
|
||||
function___annotate___set(TyObject *self, TyObject *value, void *Py_UNUSED(context))
|
||||
{
|
||||
int return_value;
|
||||
|
||||
@@ -87,7 +87,7 @@ static TyObject *
|
||||
function___annotations___get_impl(PyFunctionObject *self);
|
||||
|
||||
static TyObject *
|
||||
function___annotations___get(TyObject *self, void *Ty_UNUSED(context))
|
||||
function___annotations___get(TyObject *self, void *Py_UNUSED(context))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -112,7 +112,7 @@ static int
|
||||
function___annotations___set_impl(PyFunctionObject *self, TyObject *value);
|
||||
|
||||
static int
|
||||
function___annotations___set(TyObject *self, TyObject *value, void *Ty_UNUSED(context))
|
||||
function___annotations___set(TyObject *self, TyObject *value, void *Py_UNUSED(context))
|
||||
{
|
||||
int return_value;
|
||||
|
||||
@@ -144,7 +144,7 @@ static TyObject *
|
||||
function___type_params___get_impl(PyFunctionObject *self);
|
||||
|
||||
static TyObject *
|
||||
function___type_params___get(TyObject *self, void *Ty_UNUSED(context))
|
||||
function___type_params___get(TyObject *self, void *Py_UNUSED(context))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -169,7 +169,7 @@ static int
|
||||
function___type_params___set_impl(PyFunctionObject *self, TyObject *value);
|
||||
|
||||
static int
|
||||
function___type_params___set(TyObject *self, TyObject *value, void *Ty_UNUSED(context))
|
||||
function___type_params___set(TyObject *self, TyObject *value, void *Py_UNUSED(context))
|
||||
{
|
||||
int return_value;
|
||||
|
||||
|
||||
10
Objects/clinic/listobject.c.h
generated
10
Objects/clinic/listobject.c.h
generated
@@ -66,7 +66,7 @@ static TyObject *
|
||||
py_list_clear_impl(PyListObject *self);
|
||||
|
||||
static TyObject *
|
||||
py_list_clear(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
py_list_clear(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -90,7 +90,7 @@ static TyObject *
|
||||
list_copy_impl(PyListObject *self);
|
||||
|
||||
static TyObject *
|
||||
list_copy(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
list_copy(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -290,7 +290,7 @@ static TyObject *
|
||||
list_reverse_impl(PyListObject *self);
|
||||
|
||||
static TyObject *
|
||||
list_reverse(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
list_reverse(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -446,7 +446,7 @@ static TyObject *
|
||||
list___sizeof___impl(PyListObject *self);
|
||||
|
||||
static TyObject *
|
||||
list___sizeof__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
list___sizeof__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return list___sizeof___impl((PyListObject *)self);
|
||||
}
|
||||
@@ -464,7 +464,7 @@ static TyObject *
|
||||
list___reversed___impl(PyListObject *self);
|
||||
|
||||
static TyObject *
|
||||
list___reversed__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
list___reversed__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return list___reversed___impl((PyListObject *)self);
|
||||
}
|
||||
|
||||
12
Objects/clinic/longobject.c.h
generated
12
Objects/clinic/longobject.c.h
generated
@@ -84,7 +84,7 @@ static TyObject *
|
||||
int___getnewargs___impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
int___getnewargs__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
int___getnewargs__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return int___getnewargs___impl(self);
|
||||
}
|
||||
@@ -165,7 +165,7 @@ static Ty_ssize_t
|
||||
int___sizeof___impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
int___sizeof__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
int___sizeof__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
Ty_ssize_t _return_value;
|
||||
@@ -198,7 +198,7 @@ static TyObject *
|
||||
int_bit_length_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
int_bit_length(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
int_bit_length(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return int_bit_length_impl(self);
|
||||
}
|
||||
@@ -223,7 +223,7 @@ static TyObject *
|
||||
int_bit_count_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
int_bit_count(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
int_bit_count(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return int_bit_count_impl(self);
|
||||
}
|
||||
@@ -250,7 +250,7 @@ static TyObject *
|
||||
int_as_integer_ratio_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
int_as_integer_ratio(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
int_as_integer_ratio(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return int_as_integer_ratio_impl(self);
|
||||
}
|
||||
@@ -481,7 +481,7 @@ static TyObject *
|
||||
int_is_integer_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
int_is_integer(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
int_is_integer(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return int_is_integer_impl(self);
|
||||
}
|
||||
|
||||
6
Objects/clinic/memoryobject.c.h
generated
6
Objects/clinic/memoryobject.c.h
generated
@@ -141,7 +141,7 @@ static TyObject *
|
||||
memoryview_release_impl(PyMemoryViewObject *self);
|
||||
|
||||
static TyObject *
|
||||
memoryview_release(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
memoryview_release(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return memoryview_release_impl((PyMemoryViewObject *)self);
|
||||
}
|
||||
@@ -229,7 +229,7 @@ static TyObject *
|
||||
memoryview_toreadonly_impl(PyMemoryViewObject *self);
|
||||
|
||||
static TyObject *
|
||||
memoryview_toreadonly(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
memoryview_toreadonly(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return memoryview_toreadonly_impl((PyMemoryViewObject *)self);
|
||||
}
|
||||
@@ -247,7 +247,7 @@ static TyObject *
|
||||
memoryview_tolist_impl(PyMemoryViewObject *self);
|
||||
|
||||
static TyObject *
|
||||
memoryview_tolist(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
memoryview_tolist(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return memoryview_tolist_impl((PyMemoryViewObject *)self);
|
||||
}
|
||||
|
||||
12
Objects/clinic/setobject.c.h
generated
12
Objects/clinic/setobject.c.h
generated
@@ -19,7 +19,7 @@ static TyObject *
|
||||
set_pop_impl(PySetObject *so);
|
||||
|
||||
static TyObject *
|
||||
set_pop(TyObject *so, TyObject *Ty_UNUSED(ignored))
|
||||
set_pop(TyObject *so, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -70,7 +70,7 @@ static TyObject *
|
||||
set_copy_impl(PySetObject *so);
|
||||
|
||||
static TyObject *
|
||||
set_copy(TyObject *so, TyObject *Ty_UNUSED(ignored))
|
||||
set_copy(TyObject *so, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -94,7 +94,7 @@ static TyObject *
|
||||
frozenset_copy_impl(PySetObject *so);
|
||||
|
||||
static TyObject *
|
||||
frozenset_copy(TyObject *so, TyObject *Ty_UNUSED(ignored))
|
||||
frozenset_copy(TyObject *so, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -118,7 +118,7 @@ static TyObject *
|
||||
set_clear_impl(PySetObject *so);
|
||||
|
||||
static TyObject *
|
||||
set_clear(TyObject *so, TyObject *Ty_UNUSED(ignored))
|
||||
set_clear(TyObject *so, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -520,7 +520,7 @@ static TyObject *
|
||||
set___reduce___impl(PySetObject *so);
|
||||
|
||||
static TyObject *
|
||||
set___reduce__(TyObject *so, TyObject *Ty_UNUSED(ignored))
|
||||
set___reduce__(TyObject *so, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
@@ -544,7 +544,7 @@ static TyObject *
|
||||
set___sizeof___impl(PySetObject *so);
|
||||
|
||||
static TyObject *
|
||||
set___sizeof__(TyObject *so, TyObject *Ty_UNUSED(ignored))
|
||||
set___sizeof__(TyObject *so, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *return_value = NULL;
|
||||
|
||||
|
||||
2
Objects/clinic/tupleobject.c.h
generated
2
Objects/clinic/tupleobject.c.h
generated
@@ -123,7 +123,7 @@ static TyObject *
|
||||
tuple___getnewargs___impl(PyTupleObject *self);
|
||||
|
||||
static TyObject *
|
||||
tuple___getnewargs__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
tuple___getnewargs__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return tuple___getnewargs___impl((PyTupleObject *)self);
|
||||
}
|
||||
|
||||
16
Objects/clinic/typeobject.c.h
generated
16
Objects/clinic/typeobject.c.h
generated
@@ -73,7 +73,7 @@ static TyObject *
|
||||
type_mro_impl(TyTypeObject *self);
|
||||
|
||||
static TyObject *
|
||||
type_mro(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
type_mro(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return type_mro_impl((TyTypeObject *)self);
|
||||
}
|
||||
@@ -91,7 +91,7 @@ static TyObject *
|
||||
type___subclasses___impl(TyTypeObject *self);
|
||||
|
||||
static TyObject *
|
||||
type___subclasses__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
type___subclasses__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return type___subclasses___impl((TyTypeObject *)self);
|
||||
}
|
||||
@@ -109,7 +109,7 @@ static TyObject *
|
||||
type___dir___impl(TyTypeObject *self);
|
||||
|
||||
static TyObject *
|
||||
type___dir__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
type___dir__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return type___dir___impl((TyTypeObject *)self);
|
||||
}
|
||||
@@ -127,7 +127,7 @@ static TyObject *
|
||||
type___sizeof___impl(TyTypeObject *self);
|
||||
|
||||
static TyObject *
|
||||
type___sizeof__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
type___sizeof__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return type___sizeof___impl((TyTypeObject *)self);
|
||||
}
|
||||
@@ -145,7 +145,7 @@ static TyObject *
|
||||
object___getstate___impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
object___getstate__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
object___getstate__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return object___getstate___impl(self);
|
||||
}
|
||||
@@ -163,7 +163,7 @@ static TyObject *
|
||||
object___reduce___impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
object___reduce__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
object___reduce__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return object___reduce___impl(self);
|
||||
}
|
||||
@@ -240,7 +240,7 @@ static TyObject *
|
||||
object___sizeof___impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
object___sizeof__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
object___sizeof__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return object___sizeof___impl(self);
|
||||
}
|
||||
@@ -258,7 +258,7 @@ static TyObject *
|
||||
object___dir___impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
object___dir__(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
object___dir__(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return object___dir___impl(self);
|
||||
}
|
||||
|
||||
14
Objects/clinic/typevarobject.c.h
generated
14
Objects/clinic/typevarobject.c.h
generated
@@ -187,7 +187,7 @@ static TyObject *
|
||||
typevar_reduce_impl(typevarobject *self);
|
||||
|
||||
static TyObject *
|
||||
typevar_reduce(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
typevar_reduce(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return typevar_reduce_impl((typevarobject *)self);
|
||||
}
|
||||
@@ -204,7 +204,7 @@ static TyObject *
|
||||
typevar_has_default_impl(typevarobject *self);
|
||||
|
||||
static TyObject *
|
||||
typevar_has_default(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
typevar_has_default(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return typevar_has_default_impl((typevarobject *)self);
|
||||
}
|
||||
@@ -494,7 +494,7 @@ static TyObject *
|
||||
paramspec_reduce_impl(paramspecobject *self);
|
||||
|
||||
static TyObject *
|
||||
paramspec_reduce(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
paramspec_reduce(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return paramspec_reduce_impl((paramspecobject *)self);
|
||||
}
|
||||
@@ -511,7 +511,7 @@ static TyObject *
|
||||
paramspec_has_default_impl(paramspecobject *self);
|
||||
|
||||
static TyObject *
|
||||
paramspec_has_default(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
paramspec_has_default(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return paramspec_has_default_impl((paramspecobject *)self);
|
||||
}
|
||||
@@ -648,7 +648,7 @@ static TyObject *
|
||||
typevartuple_reduce_impl(typevartupleobject *self);
|
||||
|
||||
static TyObject *
|
||||
typevartuple_reduce(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
typevartuple_reduce(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return typevartuple_reduce_impl((typevartupleobject *)self);
|
||||
}
|
||||
@@ -665,7 +665,7 @@ static TyObject *
|
||||
typevartuple_has_default_impl(typevartupleobject *self);
|
||||
|
||||
static TyObject *
|
||||
typevartuple_has_default(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
typevartuple_has_default(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return typevartuple_has_default_impl((typevartupleobject *)self);
|
||||
}
|
||||
@@ -682,7 +682,7 @@ static TyObject *
|
||||
typealias_reduce_impl(typealiasobject *self);
|
||||
|
||||
static TyObject *
|
||||
typealias_reduce(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
typealias_reduce(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return typealias_reduce_impl((typealiasobject *)self);
|
||||
}
|
||||
|
||||
40
Objects/clinic/unicodeobject.c.h
generated
40
Objects/clinic/unicodeobject.c.h
generated
@@ -22,7 +22,7 @@ static TyObject *
|
||||
EncodingMap_size_impl(struct encoding_map *self);
|
||||
|
||||
static TyObject *
|
||||
EncodingMap_size(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
EncodingMap_size(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return EncodingMap_size_impl((struct encoding_map *)self);
|
||||
}
|
||||
@@ -43,7 +43,7 @@ static TyObject *
|
||||
unicode_title_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_title(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_title(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_title_impl(self);
|
||||
}
|
||||
@@ -64,7 +64,7 @@ static TyObject *
|
||||
unicode_capitalize_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_capitalize(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_capitalize(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_capitalize_impl(self);
|
||||
}
|
||||
@@ -82,7 +82,7 @@ static TyObject *
|
||||
unicode_casefold_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_casefold(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_casefold(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_casefold_impl(self);
|
||||
}
|
||||
@@ -490,7 +490,7 @@ static TyObject *
|
||||
unicode_isascii_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_isascii(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_isascii(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_isascii_impl(self);
|
||||
}
|
||||
@@ -511,7 +511,7 @@ static TyObject *
|
||||
unicode_islower_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_islower(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_islower(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_islower_impl(self);
|
||||
}
|
||||
@@ -532,7 +532,7 @@ static TyObject *
|
||||
unicode_isupper_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_isupper(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_isupper(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_isupper_impl(self);
|
||||
}
|
||||
@@ -553,7 +553,7 @@ static TyObject *
|
||||
unicode_istitle_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_istitle(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_istitle(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_istitle_impl(self);
|
||||
}
|
||||
@@ -574,7 +574,7 @@ static TyObject *
|
||||
unicode_isspace_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_isspace(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_isspace(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_isspace_impl(self);
|
||||
}
|
||||
@@ -595,7 +595,7 @@ static TyObject *
|
||||
unicode_isalpha_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_isalpha(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_isalpha(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_isalpha_impl(self);
|
||||
}
|
||||
@@ -616,7 +616,7 @@ static TyObject *
|
||||
unicode_isalnum_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_isalnum(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_isalnum(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_isalnum_impl(self);
|
||||
}
|
||||
@@ -637,7 +637,7 @@ static TyObject *
|
||||
unicode_isdecimal_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_isdecimal(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_isdecimal(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_isdecimal_impl(self);
|
||||
}
|
||||
@@ -658,7 +658,7 @@ static TyObject *
|
||||
unicode_isdigit_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_isdigit(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_isdigit(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_isdigit_impl(self);
|
||||
}
|
||||
@@ -679,7 +679,7 @@ static TyObject *
|
||||
unicode_isnumeric_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_isnumeric(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_isnumeric(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_isnumeric_impl(self);
|
||||
}
|
||||
@@ -700,7 +700,7 @@ static TyObject *
|
||||
unicode_isidentifier_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_isidentifier(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_isidentifier(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_isidentifier_impl(self);
|
||||
}
|
||||
@@ -720,7 +720,7 @@ static TyObject *
|
||||
unicode_isprintable_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_isprintable(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_isprintable(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_isprintable_impl(self);
|
||||
}
|
||||
@@ -801,7 +801,7 @@ static TyObject *
|
||||
unicode_lower_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_lower(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_lower(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_lower_impl(self);
|
||||
}
|
||||
@@ -1532,7 +1532,7 @@ static TyObject *
|
||||
unicode_swapcase_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_swapcase(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_swapcase(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_swapcase_impl(self);
|
||||
}
|
||||
@@ -1622,7 +1622,7 @@ static TyObject *
|
||||
unicode_upper_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_upper(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_upper(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_upper_impl(self);
|
||||
}
|
||||
@@ -1809,7 +1809,7 @@ static TyObject *
|
||||
unicode_sizeof_impl(TyObject *self);
|
||||
|
||||
static TyObject *
|
||||
unicode_sizeof(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_sizeof(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return unicode_sizeof_impl(self);
|
||||
}
|
||||
|
||||
@@ -1367,7 +1367,7 @@ static TyObject *
|
||||
_source_offset_converter(void *arg) {
|
||||
int *value = (int*)arg;
|
||||
if (*value == -1) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return TyLong_FromLong(*value);
|
||||
}
|
||||
@@ -1530,7 +1530,7 @@ TyTypeObject _PyPositionsIterator = {
|
||||
};
|
||||
|
||||
static TyObject*
|
||||
code_positionsiterator(TyObject *self, TyObject* Ty_UNUSED(args))
|
||||
code_positionsiterator(TyObject *self, TyObject* Py_UNUSED(args))
|
||||
{
|
||||
PyCodeObject *code = (PyCodeObject*)self;
|
||||
positionsiterator* pi = (positionsiterator*)TyType_GenericAlloc(&_PyPositionsIterator, 0);
|
||||
@@ -2491,16 +2491,16 @@ code_richcompare(TyObject *self, TyObject *other, int op)
|
||||
TyObject *consts1, *consts2;
|
||||
TyObject *res;
|
||||
|
||||
if ((op != Ty_EQ && op != Ty_NE) ||
|
||||
if ((op != Py_EQ && op != Py_NE) ||
|
||||
!TyCode_Check(self) ||
|
||||
!TyCode_Check(other)) {
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
co = (PyCodeObject *)self;
|
||||
cp = (PyCodeObject *)other;
|
||||
|
||||
eq = PyObject_RichCompareBool(co->co_name, cp->co_name, Ty_EQ);
|
||||
eq = PyObject_RichCompareBool(co->co_name, cp->co_name, Py_EQ);
|
||||
if (!eq) goto unequal;
|
||||
eq = co->co_argcount == cp->co_argcount;
|
||||
if (!eq) goto unequal;
|
||||
@@ -2534,27 +2534,27 @@ code_richcompare(TyObject *self, TyObject *other, int op)
|
||||
Ty_DECREF(consts1);
|
||||
return NULL;
|
||||
}
|
||||
eq = PyObject_RichCompareBool(consts1, consts2, Ty_EQ);
|
||||
eq = PyObject_RichCompareBool(consts1, consts2, Py_EQ);
|
||||
Ty_DECREF(consts1);
|
||||
Ty_DECREF(consts2);
|
||||
if (eq <= 0) goto unequal;
|
||||
|
||||
eq = PyObject_RichCompareBool(co->co_names, cp->co_names, Ty_EQ);
|
||||
eq = PyObject_RichCompareBool(co->co_names, cp->co_names, Py_EQ);
|
||||
if (eq <= 0) goto unequal;
|
||||
eq = PyObject_RichCompareBool(co->co_localsplusnames,
|
||||
cp->co_localsplusnames, Ty_EQ);
|
||||
cp->co_localsplusnames, Py_EQ);
|
||||
if (eq <= 0) goto unequal;
|
||||
eq = PyObject_RichCompareBool(co->co_linetable, cp->co_linetable, Ty_EQ);
|
||||
eq = PyObject_RichCompareBool(co->co_linetable, cp->co_linetable, Py_EQ);
|
||||
if (eq <= 0) {
|
||||
goto unequal;
|
||||
}
|
||||
eq = PyObject_RichCompareBool(co->co_exceptiontable,
|
||||
cp->co_exceptiontable, Ty_EQ);
|
||||
cp->co_exceptiontable, Py_EQ);
|
||||
if (eq <= 0) {
|
||||
goto unequal;
|
||||
}
|
||||
|
||||
if (op == Ty_EQ)
|
||||
if (op == Py_EQ)
|
||||
res = Ty_True;
|
||||
else
|
||||
res = Ty_False;
|
||||
@@ -2563,7 +2563,7 @@ code_richcompare(TyObject *self, TyObject *other, int op)
|
||||
unequal:
|
||||
if (eq < 0)
|
||||
return NULL;
|
||||
if (op == Ty_NE)
|
||||
if (op == Py_NE)
|
||||
res = Ty_True;
|
||||
else
|
||||
res = Ty_False;
|
||||
@@ -2617,20 +2617,20 @@ code_hash(TyObject *self)
|
||||
#define OFF(x) offsetof(PyCodeObject, x)
|
||||
|
||||
static TyMemberDef code_memberlist[] = {
|
||||
{"co_argcount", Ty_T_INT, OFF(co_argcount), Ty_READONLY},
|
||||
{"co_posonlyargcount", Ty_T_INT, OFF(co_posonlyargcount), Ty_READONLY},
|
||||
{"co_kwonlyargcount", Ty_T_INT, OFF(co_kwonlyargcount), Ty_READONLY},
|
||||
{"co_stacksize", Ty_T_INT, OFF(co_stacksize), Ty_READONLY},
|
||||
{"co_flags", Ty_T_INT, OFF(co_flags), Ty_READONLY},
|
||||
{"co_nlocals", Ty_T_INT, OFF(co_nlocals), Ty_READONLY},
|
||||
{"co_consts", _Ty_T_OBJECT, OFF(co_consts), Ty_READONLY},
|
||||
{"co_names", _Ty_T_OBJECT, OFF(co_names), Ty_READONLY},
|
||||
{"co_filename", _Ty_T_OBJECT, OFF(co_filename), Ty_READONLY},
|
||||
{"co_name", _Ty_T_OBJECT, OFF(co_name), Ty_READONLY},
|
||||
{"co_qualname", _Ty_T_OBJECT, OFF(co_qualname), Ty_READONLY},
|
||||
{"co_firstlineno", Ty_T_INT, OFF(co_firstlineno), Ty_READONLY},
|
||||
{"co_linetable", _Ty_T_OBJECT, OFF(co_linetable), Ty_READONLY},
|
||||
{"co_exceptiontable", _Ty_T_OBJECT, OFF(co_exceptiontable), Ty_READONLY},
|
||||
{"co_argcount", Ty_T_INT, OFF(co_argcount), Py_READONLY},
|
||||
{"co_posonlyargcount", Ty_T_INT, OFF(co_posonlyargcount), Py_READONLY},
|
||||
{"co_kwonlyargcount", Ty_T_INT, OFF(co_kwonlyargcount), Py_READONLY},
|
||||
{"co_stacksize", Ty_T_INT, OFF(co_stacksize), Py_READONLY},
|
||||
{"co_flags", Ty_T_INT, OFF(co_flags), Py_READONLY},
|
||||
{"co_nlocals", Ty_T_INT, OFF(co_nlocals), Py_READONLY},
|
||||
{"co_consts", _Ty_T_OBJECT, OFF(co_consts), Py_READONLY},
|
||||
{"co_names", _Ty_T_OBJECT, OFF(co_names), Py_READONLY},
|
||||
{"co_filename", _Ty_T_OBJECT, OFF(co_filename), Py_READONLY},
|
||||
{"co_name", _Ty_T_OBJECT, OFF(co_name), Py_READONLY},
|
||||
{"co_qualname", _Ty_T_OBJECT, OFF(co_qualname), Py_READONLY},
|
||||
{"co_firstlineno", Ty_T_INT, OFF(co_firstlineno), Py_READONLY},
|
||||
{"co_linetable", _Ty_T_OBJECT, OFF(co_linetable), Py_READONLY},
|
||||
{"co_exceptiontable", _Ty_T_OBJECT, OFF(co_exceptiontable), Py_READONLY},
|
||||
{NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
@@ -2696,7 +2696,7 @@ static TyGetSetDef code_getsetlist[] = {
|
||||
|
||||
|
||||
static TyObject *
|
||||
code_sizeof(TyObject *self, TyObject *Ty_UNUSED(args))
|
||||
code_sizeof(TyObject *self, TyObject *Py_UNUSED(args))
|
||||
{
|
||||
PyCodeObject *co = _PyCodeObject_CAST(self);
|
||||
size_t res = _TyObject_VAR_SIZE(Ty_TYPE(co), Ty_SIZE(co));
|
||||
@@ -2709,14 +2709,14 @@ code_sizeof(TyObject *self, TyObject *Ty_UNUSED(args))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
code_linesiterator(TyObject *self, TyObject *Ty_UNUSED(args))
|
||||
code_linesiterator(TyObject *self, TyObject *Py_UNUSED(args))
|
||||
{
|
||||
PyCodeObject *code = _PyCodeObject_CAST(self);
|
||||
return (TyObject *)new_linesiterator(code);
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
code_branchesiterator(TyObject *self, TyObject *Ty_UNUSED(args))
|
||||
code_branchesiterator(TyObject *self, TyObject *Py_UNUSED(args))
|
||||
{
|
||||
PyCodeObject *code = _PyCodeObject_CAST(self);
|
||||
return _PyInstrumentation_BranchesIterator(code);
|
||||
@@ -3171,7 +3171,7 @@ compare_constants(const void *key1, const void *key2)
|
||||
s1->step == s2->step);
|
||||
}
|
||||
else if (TyBytes_CheckExact(op1) || TyLong_CheckExact(op1)) {
|
||||
return PyObject_RichCompareBool(op1, op2, Ty_EQ);
|
||||
return PyObject_RichCompareBool(op1, op2, Py_EQ);
|
||||
}
|
||||
else if (TyFloat_CheckExact(op1)) {
|
||||
// Ensure that, for example, +0.0 and -0.0 are distinct
|
||||
|
||||
@@ -697,7 +697,7 @@ real_to_complex(TyObject **pobj, Ty_complex *pc)
|
||||
} \
|
||||
} \
|
||||
else if (!TyComplex_Check(v)) { \
|
||||
Ty_RETURN_NOTIMPLEMENTED; \
|
||||
Py_RETURN_NOTIMPLEMENTED; \
|
||||
} \
|
||||
else { \
|
||||
a = ((PyComplexObject *)v)->cval; \
|
||||
@@ -803,7 +803,7 @@ complex_richcompare(TyObject *v, TyObject *w, int op)
|
||||
Ty_complex i;
|
||||
int equal;
|
||||
|
||||
if (op != Ty_EQ && op != Ty_NE) {
|
||||
if (op != Py_EQ && op != Py_NE) {
|
||||
goto Unimplemented;
|
||||
}
|
||||
|
||||
@@ -841,7 +841,7 @@ complex_richcompare(TyObject *v, TyObject *w, int op)
|
||||
goto Unimplemented;
|
||||
}
|
||||
|
||||
if (equal == (op == Ty_EQ))
|
||||
if (equal == (op == Py_EQ))
|
||||
res = Ty_True;
|
||||
else
|
||||
res = Ty_False;
|
||||
@@ -849,7 +849,7 @@ complex_richcompare(TyObject *v, TyObject *w, int op)
|
||||
return Ty_NewRef(res);
|
||||
|
||||
Unimplemented:
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -1335,9 +1335,9 @@ static TyMethodDef complex_methods[] = {
|
||||
};
|
||||
|
||||
static TyMemberDef complex_members[] = {
|
||||
{"real", Ty_T_DOUBLE, offsetof(PyComplexObject, cval.real), Ty_READONLY,
|
||||
{"real", Ty_T_DOUBLE, offsetof(PyComplexObject, cval.real), Py_READONLY,
|
||||
"the real part of a complex number"},
|
||||
{"imag", Ty_T_DOUBLE, offsetof(PyComplexObject, cval.imag), Ty_READONLY,
|
||||
{"imag", Ty_T_DOUBLE, offsetof(PyComplexObject, cval.imag), Py_READONLY,
|
||||
"the imaginary part of a complex number"},
|
||||
{0},
|
||||
};
|
||||
|
||||
@@ -618,7 +618,7 @@ calculate_qualname(PyDescrObject *descr)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
descr_get_qualname(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
descr_get_qualname(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyDescrObject *descr = (PyDescrObject *)self;
|
||||
if (descr->d_qualname == NULL)
|
||||
@@ -627,7 +627,7 @@ descr_get_qualname(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
descr_reduce(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
descr_reduce(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyDescrObject *descr = (PyDescrObject *)self;
|
||||
return Ty_BuildValue("N(OO)", _TyEval_GetBuiltin(&_Ty_ID(getattr)),
|
||||
@@ -640,8 +640,8 @@ static TyMethodDef descr_methods[] = {
|
||||
};
|
||||
|
||||
static TyMemberDef descr_members[] = {
|
||||
{"__objclass__", _Ty_T_OBJECT, offsetof(PyDescrObject, d_type), Ty_READONLY},
|
||||
{"__name__", _Ty_T_OBJECT, offsetof(PyDescrObject, d_name), Ty_READONLY},
|
||||
{"__objclass__", _Ty_T_OBJECT, offsetof(PyDescrObject, d_type), Py_READONLY},
|
||||
{"__name__", _Ty_T_OBJECT, offsetof(PyDescrObject, d_name), Py_READONLY},
|
||||
{0}
|
||||
};
|
||||
|
||||
@@ -657,7 +657,7 @@ member_get_doc(TyObject *_descr, void *closure)
|
||||
{
|
||||
PyMemberDescrObject *descr = (PyMemberDescrObject *)_descr;
|
||||
if (descr->d_member->doc == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return TyUnicode_FromString(descr->d_member->doc);
|
||||
}
|
||||
@@ -673,7 +673,7 @@ getset_get_doc(TyObject *self, void *closure)
|
||||
{
|
||||
PyGetSetDescrObject *descr = (PyGetSetDescrObject *)self;
|
||||
if (descr->d_getset->doc == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return TyUnicode_FromString(descr->d_getset->doc);
|
||||
}
|
||||
@@ -1074,7 +1074,7 @@ mappingproxy_or(TyObject *left, TyObject *right)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
mappingproxy_ior(TyObject *self, TyObject *Ty_UNUSED(other))
|
||||
mappingproxy_ior(TyObject *self, TyObject *Py_UNUSED(other))
|
||||
{
|
||||
return TyErr_Format(TyExc_TypeError,
|
||||
"'|=' is not supported by %s; use '|' instead", Ty_TYPE(self)->tp_name);
|
||||
@@ -1128,35 +1128,35 @@ mappingproxy_get(TyObject *self, TyObject *const *args, Ty_ssize_t nargs)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
mappingproxy_keys(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
mappingproxy_keys(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
mappingproxyobject *pp = (mappingproxyobject *)self;
|
||||
return PyObject_CallMethodNoArgs(pp->mapping, &_Ty_ID(keys));
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
mappingproxy_values(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
mappingproxy_values(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
mappingproxyobject *pp = (mappingproxyobject *)self;
|
||||
return PyObject_CallMethodNoArgs(pp->mapping, &_Ty_ID(values));
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
mappingproxy_items(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
mappingproxy_items(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
mappingproxyobject *pp = (mappingproxyobject *)self;
|
||||
return PyObject_CallMethodNoArgs(pp->mapping, &_Ty_ID(items));
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
mappingproxy_copy(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
mappingproxy_copy(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
mappingproxyobject *pp = (mappingproxyobject *)self;
|
||||
return PyObject_CallMethodNoArgs(pp->mapping, &_Ty_ID(copy));
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
mappingproxy_reversed(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
mappingproxy_reversed(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
mappingproxyobject *pp = (mappingproxyobject *)self;
|
||||
return PyObject_CallMethodNoArgs(pp->mapping, &_Ty_ID(__reversed__));
|
||||
@@ -1325,20 +1325,20 @@ wrapper_richcompare(TyObject *a, TyObject *b, int op)
|
||||
assert(a != NULL && b != NULL);
|
||||
|
||||
/* both arguments should be wrapperobjects */
|
||||
if ((op != Ty_EQ && op != Ty_NE)
|
||||
if ((op != Py_EQ && op != Py_NE)
|
||||
|| !Wrapper_Check(a) || !Wrapper_Check(b))
|
||||
{
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
wa = (wrapperobject *)a;
|
||||
wb = (wrapperobject *)b;
|
||||
eq = (wa->descr == wb->descr && wa->self == wb->self);
|
||||
if (eq == (op == Ty_EQ)) {
|
||||
Ty_RETURN_TRUE;
|
||||
if (eq == (op == Py_EQ)) {
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
else {
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1366,7 +1366,7 @@ wrapper_repr(TyObject *self)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
wrapper_reduce(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
wrapper_reduce(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
wrapperobject *wp = (wrapperobject *)self;
|
||||
return Ty_BuildValue("N(OO)", _TyEval_GetBuiltin(&_Ty_ID(getattr)),
|
||||
@@ -1379,12 +1379,12 @@ static TyMethodDef wrapper_methods[] = {
|
||||
};
|
||||
|
||||
static TyMemberDef wrapper_members[] = {
|
||||
{"__self__", _Ty_T_OBJECT, offsetof(wrapperobject, self), Ty_READONLY},
|
||||
{"__self__", _Ty_T_OBJECT, offsetof(wrapperobject, self), Py_READONLY},
|
||||
{0}
|
||||
};
|
||||
|
||||
static TyObject *
|
||||
wrapper_objclass(TyObject *wp, void *Ty_UNUSED(ignored))
|
||||
wrapper_objclass(TyObject *wp, void *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *c = (TyObject *)PyDescr_TYPE(((wrapperobject *)wp)->descr);
|
||||
|
||||
@@ -1392,7 +1392,7 @@ wrapper_objclass(TyObject *wp, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
wrapper_name(TyObject *wp, void *Ty_UNUSED(ignored))
|
||||
wrapper_name(TyObject *wp, void *Py_UNUSED(ignored))
|
||||
{
|
||||
const char *s = ((wrapperobject *)wp)->descr->d_base->name;
|
||||
|
||||
@@ -1400,14 +1400,14 @@ wrapper_name(TyObject *wp, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
wrapper_doc(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
wrapper_doc(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
wrapperobject *wp = (wrapperobject *)self;
|
||||
return _TyType_GetDocFromInternalDoc(wp->descr->d_base->name, wp->descr->d_base->doc);
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
wrapper_text_signature(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
wrapper_text_signature(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
wrapperobject *wp = (wrapperobject *)self;
|
||||
return _TyType_GetTextSignatureFromInternalDoc(wp->descr->d_base->name,
|
||||
@@ -1415,7 +1415,7 @@ wrapper_text_signature(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
wrapper_qualname(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
wrapper_qualname(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
wrapperobject *wp = (wrapperobject *)self;
|
||||
return descr_get_qualname((TyObject *)wp->descr, NULL);
|
||||
@@ -1558,9 +1558,9 @@ static TyObject * property_copy(TyObject *, TyObject *, TyObject *,
|
||||
TyObject *);
|
||||
|
||||
static TyMemberDef property_members[] = {
|
||||
{"fget", _Ty_T_OBJECT, offsetof(propertyobject, prop_get), Ty_READONLY},
|
||||
{"fset", _Ty_T_OBJECT, offsetof(propertyobject, prop_set), Ty_READONLY},
|
||||
{"fdel", _Ty_T_OBJECT, offsetof(propertyobject, prop_del), Ty_READONLY},
|
||||
{"fget", _Ty_T_OBJECT, offsetof(propertyobject, prop_get), Py_READONLY},
|
||||
{"fset", _Ty_T_OBJECT, offsetof(propertyobject, prop_set), Py_READONLY},
|
||||
{"fdel", _Ty_T_OBJECT, offsetof(propertyobject, prop_del), Py_READONLY},
|
||||
{"__doc__", _Ty_T_OBJECT, offsetof(propertyobject, prop_doc), 0},
|
||||
{0}
|
||||
};
|
||||
@@ -1617,7 +1617,7 @@ property_set_name(TyObject *self, TyObject *args) {
|
||||
|
||||
Ty_XSETREF(prop->prop_name, Ty_XNewRef(name));
|
||||
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyMethodDef property_methods[] = {
|
||||
@@ -1912,7 +1912,7 @@ property_init_impl(propertyobject *self, TyObject *fget, TyObject *fset,
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
property_get__name__(TyObject *op, void *Ty_UNUSED(ignored))
|
||||
property_get__name__(TyObject *op, void *Py_UNUSED(ignored))
|
||||
{
|
||||
propertyobject *prop = _propertyobject_CAST(op);
|
||||
TyObject *name;
|
||||
@@ -1927,7 +1927,7 @@ property_get__name__(TyObject *op, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static int
|
||||
property_set__name__(TyObject *op, TyObject *value, void *Ty_UNUSED(ignored))
|
||||
property_set__name__(TyObject *op, TyObject *value, void *Py_UNUSED(ignored))
|
||||
{
|
||||
propertyobject *prop = _propertyobject_CAST(op);
|
||||
Ty_XSETREF(prop->prop_name, Ty_XNewRef(value));
|
||||
@@ -1943,7 +1943,7 @@ property_get___isabstractmethod__(TyObject *op, void *closure)
|
||||
return NULL;
|
||||
}
|
||||
else if (res) {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
res = _TyObject_IsAbstract(prop->prop_set);
|
||||
@@ -1951,7 +1951,7 @@ property_get___isabstractmethod__(TyObject *op, void *closure)
|
||||
return NULL;
|
||||
}
|
||||
else if (res) {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
res = _TyObject_IsAbstract(prop->prop_del);
|
||||
@@ -1959,9 +1959,9 @@ property_get___isabstractmethod__(TyObject *op, void *closure)
|
||||
return NULL;
|
||||
}
|
||||
else if (res) {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
static TyGetSetDef property_getsetlist[] = {
|
||||
|
||||
@@ -156,7 +156,7 @@ ASSERT_DICT_LOCKED(TyObject *op)
|
||||
{
|
||||
_Ty_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(op);
|
||||
}
|
||||
#define ASSERT_DICT_LOCKED(op) ASSERT_DICT_LOCKED(_Ty_CAST(TyObject*, op))
|
||||
#define ASSERT_DICT_LOCKED(op) ASSERT_DICT_LOCKED(_Py_CAST(TyObject*, op))
|
||||
#define ASSERT_WORLD_STOPPED_OR_DICT_LOCKED(op) \
|
||||
if (!_TyInterpreterState_GET()->stoptheworld.world_stopped) { \
|
||||
ASSERT_DICT_LOCKED(op); \
|
||||
@@ -1054,7 +1054,7 @@ compare_unicode_generic(PyDictObject *mp, PyDictKeysObject *dk,
|
||||
if (unicode_get_hash(ep->me_key) == hash) {
|
||||
TyObject *startkey = ep->me_key;
|
||||
Ty_INCREF(startkey);
|
||||
int cmp = PyObject_RichCompareBool(startkey, key, Ty_EQ);
|
||||
int cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
|
||||
Ty_DECREF(startkey);
|
||||
if (cmp < 0) {
|
||||
return DKIX_ERROR;
|
||||
@@ -1110,7 +1110,7 @@ compare_generic(PyDictObject *mp, PyDictKeysObject *dk,
|
||||
if (ep->me_hash == hash) {
|
||||
TyObject *startkey = ep->me_key;
|
||||
Ty_INCREF(startkey);
|
||||
int cmp = PyObject_RichCompareBool(startkey, key, Ty_EQ);
|
||||
int cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
|
||||
Ty_DECREF(startkey);
|
||||
if (cmp < 0) {
|
||||
return DKIX_ERROR;
|
||||
@@ -1385,7 +1385,7 @@ compare_unicode_generic_threadsafe(PyDictObject *mp, PyDictKeysObject *dk,
|
||||
}
|
||||
|
||||
if (unicode_get_hash(startkey) == hash) {
|
||||
int cmp = PyObject_RichCompareBool(startkey, key, Ty_EQ);
|
||||
int cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
|
||||
Ty_DECREF(startkey);
|
||||
if (cmp < 0) {
|
||||
return DKIX_ERROR;
|
||||
@@ -1463,7 +1463,7 @@ compare_generic_threadsafe(PyDictObject *mp, PyDictKeysObject *dk,
|
||||
if (startkey == NULL || !_Ty_TryIncrefCompare(&ep->me_key, startkey)) {
|
||||
return DKIX_KEY_CHANGED;
|
||||
}
|
||||
int cmp = PyObject_RichCompareBool(startkey, key, Ty_EQ);
|
||||
int cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
|
||||
Ty_DECREF(startkey);
|
||||
if (cmp < 0) {
|
||||
return DKIX_ERROR;
|
||||
@@ -3691,7 +3691,7 @@ static TyObject *
|
||||
dict_update(TyObject *self, TyObject *args, TyObject *kwds)
|
||||
{
|
||||
if (dict_update_common(self, args, kwds, "update") != -1)
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -4167,7 +4167,7 @@ TyDict_Size(TyObject *mp)
|
||||
|
||||
/* Return 1 if dicts equal, 0 if not, -1 if error.
|
||||
* Gets out as soon as any difference is detected.
|
||||
* Uses only Ty_EQ comparison.
|
||||
* Uses only Py_EQ comparison.
|
||||
*/
|
||||
static int
|
||||
dict_equal_lock_held(PyDictObject *a, PyDictObject *b)
|
||||
@@ -4220,7 +4220,7 @@ dict_equal_lock_held(PyDictObject *a, PyDictObject *b)
|
||||
return 0;
|
||||
}
|
||||
Ty_INCREF(bval);
|
||||
cmp = PyObject_RichCompareBool(aval, bval, Ty_EQ);
|
||||
cmp = PyObject_RichCompareBool(aval, bval, Py_EQ);
|
||||
Ty_DECREF(key);
|
||||
Ty_DECREF(aval);
|
||||
Ty_DECREF(bval);
|
||||
@@ -4251,11 +4251,11 @@ dict_richcompare(TyObject *v, TyObject *w, int op)
|
||||
if (!TyDict_Check(v) || !TyDict_Check(w)) {
|
||||
res = Ty_NotImplemented;
|
||||
}
|
||||
else if (op == Ty_EQ || op == Ty_NE) {
|
||||
else if (op == Py_EQ || op == Py_NE) {
|
||||
cmp = dict_equal((PyDictObject *)v, (PyDictObject *)w);
|
||||
if (cmp < 0)
|
||||
return NULL;
|
||||
res = (cmp == (op == Ty_EQ)) ? Ty_True : Ty_False;
|
||||
res = (cmp == (op == Py_EQ)) ? Ty_True : Ty_False;
|
||||
}
|
||||
else
|
||||
res = Ty_NotImplemented;
|
||||
@@ -4282,9 +4282,9 @@ dict___contains___impl(PyDictObject *self, TyObject *key)
|
||||
return NULL;
|
||||
}
|
||||
if (contains) {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -4493,7 +4493,7 @@ dict_clear_impl(PyDictObject *self)
|
||||
/*[clinic end generated code: output=5139a830df00830a input=0bf729baba97a4c2]*/
|
||||
{
|
||||
TyDict_Clear((TyObject *)self);
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -4709,7 +4709,7 @@ static TyObject *
|
||||
dict_or(TyObject *self, TyObject *other)
|
||||
{
|
||||
if (!TyDict_Check(self) || !TyDict_Check(other)) {
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
TyObject *new = TyDict_Copy(self);
|
||||
if (new == NULL) {
|
||||
@@ -5123,7 +5123,7 @@ dictiter_traverse(TyObject *self, visitproc visit, void *arg)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
dictiter_len(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
dictiter_len(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
dictiterobject *di = (dictiterobject *)self;
|
||||
Ty_ssize_t len = 0;
|
||||
@@ -5136,7 +5136,7 @@ PyDoc_STRVAR(length_hint_doc,
|
||||
"Private method returning an estimate of len(list(it)).");
|
||||
|
||||
static TyObject *
|
||||
dictiter_reduce(TyObject *di, TyObject *Ty_UNUSED(ignored));
|
||||
dictiter_reduce(TyObject *di, TyObject *Py_UNUSED(ignored));
|
||||
|
||||
PyDoc_STRVAR(reduce_doc, "Return state information for pickling.");
|
||||
|
||||
@@ -5854,7 +5854,7 @@ dict___reversed___impl(PyDictObject *self)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
dictiter_reduce(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
dictiter_reduce(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
dictiterobject *di = (dictiterobject *)self;
|
||||
/* copy the iterator state */
|
||||
@@ -5950,7 +5950,7 @@ _PyDictView_New(TyObject *dict, TyTypeObject *type)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
dictview_mapping(TyObject *view, void *Ty_UNUSED(ignored)) {
|
||||
dictview_mapping(TyObject *view, void *Py_UNUSED(ignored)) {
|
||||
assert(view != NULL);
|
||||
assert(PyDictKeys_Check(view)
|
||||
|| PyDictValues_Check(view)
|
||||
@@ -6011,7 +6011,7 @@ dictview_richcompare(TyObject *self, TyObject *other, int op)
|
||||
assert(other != NULL);
|
||||
|
||||
if (!PyAnySet_Check(other) && !PyDictViewSet_Check(other))
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
|
||||
len_self = PyObject_Size(self);
|
||||
if (len_self < 0)
|
||||
@@ -6023,30 +6023,30 @@ dictview_richcompare(TyObject *self, TyObject *other, int op)
|
||||
ok = 0;
|
||||
switch(op) {
|
||||
|
||||
case Ty_NE:
|
||||
case Ty_EQ:
|
||||
case Py_NE:
|
||||
case Py_EQ:
|
||||
if (len_self == len_other)
|
||||
ok = all_contained_in(self, other);
|
||||
if (op == Ty_NE && ok >= 0)
|
||||
if (op == Py_NE && ok >= 0)
|
||||
ok = !ok;
|
||||
break;
|
||||
|
||||
case Ty_LT:
|
||||
case Py_LT:
|
||||
if (len_self < len_other)
|
||||
ok = all_contained_in(self, other);
|
||||
break;
|
||||
|
||||
case Ty_LE:
|
||||
case Py_LE:
|
||||
if (len_self <= len_other)
|
||||
ok = all_contained_in(self, other);
|
||||
break;
|
||||
|
||||
case Ty_GT:
|
||||
case Py_GT:
|
||||
if (len_self > len_other)
|
||||
ok = all_contained_in(other, self);
|
||||
break;
|
||||
|
||||
case Ty_GE:
|
||||
case Py_GE:
|
||||
if (len_self >= len_other)
|
||||
ok = all_contained_in(other, self);
|
||||
break;
|
||||
@@ -6089,7 +6089,7 @@ dictkeys_iter(TyObject *self)
|
||||
{
|
||||
_PyDictViewObject *dv = (_PyDictViewObject *)self;
|
||||
if (dv->dv_dict == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return dictiter_new(dv->dv_dict, &PyDictIterKey_Type);
|
||||
}
|
||||
@@ -6287,7 +6287,7 @@ dictitems_xor_lock_held(TyObject *d1, TyObject *d2)
|
||||
}
|
||||
else {
|
||||
Ty_INCREF(val1);
|
||||
to_delete = PyObject_RichCompareBool(val1, val2, Ty_EQ);
|
||||
to_delete = PyObject_RichCompareBool(val1, val2, Py_EQ);
|
||||
if (to_delete < 0) {
|
||||
goto error;
|
||||
}
|
||||
@@ -6402,9 +6402,9 @@ dictviews_isdisjoint(TyObject *self, TyObject *other)
|
||||
|
||||
if (self == other) {
|
||||
if (dictview_len(self) == 0)
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
else
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* Iterate over the shorter object (only if other is a set,
|
||||
@@ -6436,19 +6436,19 @@ dictviews_isdisjoint(TyObject *self, TyObject *other)
|
||||
|
||||
if (contains) {
|
||||
Ty_DECREF(it);
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
Ty_DECREF(it);
|
||||
if (TyErr_Occurred())
|
||||
return NULL; /* TyIter_Next raised an exception. */
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(isdisjoint_doc,
|
||||
"Return True if the view and the given iterable have a null intersection.");
|
||||
|
||||
static TyObject* dictkeys_reversed(TyObject *dv, TyObject *Ty_UNUSED(ignored));
|
||||
static TyObject* dictkeys_reversed(TyObject *dv, TyObject *Py_UNUSED(ignored));
|
||||
|
||||
PyDoc_STRVAR(reversed_keys_doc,
|
||||
"Return a reverse iterator over the dict keys.");
|
||||
@@ -6508,11 +6508,11 @@ dict_keys_impl(PyDictObject *self)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
dictkeys_reversed(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
dictkeys_reversed(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
_PyDictViewObject *dv = (_PyDictViewObject *)self;
|
||||
if (dv->dv_dict == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return dictiter_new(dv->dv_dict, &PyDictRevIterKey_Type);
|
||||
}
|
||||
@@ -6524,7 +6524,7 @@ dictitems_iter(TyObject *self)
|
||||
{
|
||||
_PyDictViewObject *dv = (_PyDictViewObject *)self;
|
||||
if (dv->dv_dict == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return dictiter_new(dv->dv_dict, &PyDictIterItem_Type);
|
||||
}
|
||||
@@ -6543,7 +6543,7 @@ dictitems_contains(TyObject *self, TyObject *obj)
|
||||
value = TyTuple_GET_ITEM(obj, 1);
|
||||
result = TyDict_GetItemRef((TyObject *)dv->dv_dict, key, &found);
|
||||
if (result == 1) {
|
||||
result = PyObject_RichCompareBool(found, value, Ty_EQ);
|
||||
result = PyObject_RichCompareBool(found, value, Py_EQ);
|
||||
Ty_DECREF(found);
|
||||
}
|
||||
return result;
|
||||
@@ -6560,7 +6560,7 @@ static PySequenceMethods dictitems_as_sequence = {
|
||||
dictitems_contains, /* sq_contains */
|
||||
};
|
||||
|
||||
static TyObject* dictitems_reversed(TyObject *dv, TyObject *Ty_UNUSED(ignored));
|
||||
static TyObject* dictitems_reversed(TyObject *dv, TyObject *Py_UNUSED(ignored));
|
||||
|
||||
PyDoc_STRVAR(reversed_items_doc,
|
||||
"Return a reverse iterator over the dict items.");
|
||||
@@ -6620,11 +6620,11 @@ dict_items_impl(PyDictObject *self)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
dictitems_reversed(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
dictitems_reversed(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
_PyDictViewObject *dv = (_PyDictViewObject *)self;
|
||||
if (dv->dv_dict == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return dictiter_new(dv->dv_dict, &PyDictRevIterItem_Type);
|
||||
}
|
||||
@@ -6636,7 +6636,7 @@ dictvalues_iter(TyObject *self)
|
||||
{
|
||||
_PyDictViewObject *dv = (_PyDictViewObject *)self;
|
||||
if (dv->dv_dict == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return dictiter_new(dv->dv_dict, &PyDictIterValue_Type);
|
||||
}
|
||||
@@ -6652,7 +6652,7 @@ static PySequenceMethods dictvalues_as_sequence = {
|
||||
0, /* sq_contains */
|
||||
};
|
||||
|
||||
static TyObject* dictvalues_reversed(TyObject *dv, TyObject *Ty_UNUSED(ignored));
|
||||
static TyObject* dictvalues_reversed(TyObject *dv, TyObject *Py_UNUSED(ignored));
|
||||
|
||||
PyDoc_STRVAR(reversed_values_doc,
|
||||
"Return a reverse iterator over the dict values.");
|
||||
@@ -6710,11 +6710,11 @@ dict_values_impl(PyDictObject *self)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
dictvalues_reversed(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
dictvalues_reversed(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
_PyDictViewObject *dv = (_PyDictViewObject *)self;
|
||||
if (dv->dv_dict == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return dictiter_new(dv->dv_dict, &PyDictRevIterValue_Type);
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ enum_next(TyObject *op)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
enum_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
enum_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
enumobject *en = _enumobject_CAST(op);
|
||||
TyObject *result;
|
||||
@@ -475,7 +475,7 @@ reversed_next(TyObject *op)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
reversed_len(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
reversed_len(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
reversedobject *ro = _reversedobject_CAST(op);
|
||||
Ty_ssize_t position, seqsize;
|
||||
@@ -494,7 +494,7 @@ reversed_len(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).");
|
||||
|
||||
static TyObject *
|
||||
reversed_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
reversed_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
reversedobject *ro = _reversedobject_CAST(op);
|
||||
Ty_ssize_t index = FT_ATOMIC_LOAD_SSIZE_RELAXED(ro->index);
|
||||
@@ -527,7 +527,7 @@ reversed_setstate(TyObject *op, TyObject *state)
|
||||
index = n-1;
|
||||
FT_ATOMIC_STORE_SSIZE_RELAXED(ro->index, index);
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(setstate_doc, "Set state information for unpickling.");
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <stdbool.h>
|
||||
#include "pycore_abstract.h" // _TyObject_RealIsSubclass()
|
||||
#include "pycore_ceval.h" // _Ty_EnterRecursiveCall
|
||||
#include "pycore_exceptions.h" // struct _Ty_exc_state
|
||||
#include "pycore_exceptions.h" // struct _Py_exc_state
|
||||
#include "pycore_initconfig.h"
|
||||
#include "pycore_modsupport.h" // _TyArg_NoKeywords()
|
||||
#include "pycore_object.h"
|
||||
@@ -34,7 +34,7 @@ TyObject *TyExc_WindowsError = NULL; // borrowed ref
|
||||
#endif
|
||||
|
||||
|
||||
static struct _Ty_exc_state*
|
||||
static struct _Py_exc_state*
|
||||
get_exc_state(void)
|
||||
{
|
||||
PyInterpreterState *interp = _TyInterpreterState_GET();
|
||||
@@ -262,7 +262,7 @@ BaseException___setstate___impl(PyBaseExceptionObject *self, TyObject *state)
|
||||
}
|
||||
}
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ BaseException_add_note_impl(PyBaseExceptionObject *self, TyObject *note)
|
||||
return NULL;
|
||||
}
|
||||
Ty_DECREF(notes);
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyMethodDef BaseException_methods[] = {
|
||||
@@ -344,7 +344,7 @@ BaseException_args_get_impl(PyBaseExceptionObject *self)
|
||||
/*[clinic end generated code: output=e02e34e35cf4d677 input=64282386e4d7822d]*/
|
||||
{
|
||||
if (self->args == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return Ty_NewRef(self->args);
|
||||
}
|
||||
@@ -382,7 +382,7 @@ BaseException___traceback___get_impl(PyBaseExceptionObject *self)
|
||||
/*[clinic end generated code: output=17cf874a52339398 input=a2277f0de62170cf]*/
|
||||
{
|
||||
if (self->traceback == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return Ty_NewRef(self->traceback);
|
||||
}
|
||||
@@ -428,7 +428,7 @@ BaseException___context___get_impl(PyBaseExceptionObject *self)
|
||||
/*[clinic end generated code: output=6ec5d296ce8d1c93 input=b2d22687937e66ab]*/
|
||||
{
|
||||
if (self->context == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return Ty_NewRef(self->context);
|
||||
}
|
||||
@@ -471,7 +471,7 @@ BaseException___cause___get_impl(PyBaseExceptionObject *self)
|
||||
/*[clinic end generated code: output=987f6c4d8a0bdbab input=40e0eac427b6e602]*/
|
||||
{
|
||||
if (self->cause == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return Ty_NewRef(self->cause);
|
||||
}
|
||||
@@ -885,7 +885,7 @@ PyBaseExceptionGroupObject_CAST(TyObject *exc)
|
||||
static TyObject *
|
||||
BaseExceptionGroup_new(TyTypeObject *type, TyObject *args, TyObject *kwds)
|
||||
{
|
||||
struct _Ty_exc_state *state = get_exc_state();
|
||||
struct _Py_exc_state *state = get_exc_state();
|
||||
TyTypeObject *TyExc_ExceptionGroup =
|
||||
(TyTypeObject*)state->TyExc_ExceptionGroup;
|
||||
|
||||
@@ -1679,9 +1679,9 @@ PyUnstable_Exc_PrepReraiseStar(TyObject *orig, TyObject *excs)
|
||||
}
|
||||
|
||||
static TyMemberDef BaseExceptionGroup_members[] = {
|
||||
{"message", _Ty_T_OBJECT, offsetof(PyBaseExceptionGroupObject, msg), Ty_READONLY,
|
||||
{"message", _Ty_T_OBJECT, offsetof(PyBaseExceptionGroupObject, msg), Py_READONLY,
|
||||
PyDoc_STR("exception message")},
|
||||
{"exceptions", _Ty_T_OBJECT, offsetof(PyBaseExceptionGroupObject, excs), Ty_READONLY,
|
||||
{"exceptions", _Ty_T_OBJECT, offsetof(PyBaseExceptionGroupObject, excs), Py_READONLY,
|
||||
PyDoc_STR("nested exceptions")},
|
||||
{NULL} /* Sentinel */
|
||||
};
|
||||
@@ -1706,7 +1706,7 @@ ComplexExtendsException(TyExc_BaseException, BaseExceptionGroup,
|
||||
*/
|
||||
static TyObject*
|
||||
create_exception_group_class(void) {
|
||||
struct _Ty_exc_state *state = get_exc_state();
|
||||
struct _Py_exc_state *state = get_exc_state();
|
||||
|
||||
TyObject *bases = TyTuple_Pack(
|
||||
2, TyExc_BaseExceptionGroup, TyExc_Exception);
|
||||
@@ -1843,13 +1843,13 @@ ImportError_getstate(TyObject *op)
|
||||
return Ty_NewRef(dict);
|
||||
}
|
||||
else {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Pickling support */
|
||||
static TyObject *
|
||||
ImportError_reduce(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
ImportError_reduce(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *res;
|
||||
TyObject *state = ImportError_getstate(self);
|
||||
@@ -2088,7 +2088,7 @@ OSError_new(TyTypeObject *type, TyObject *args, TyObject *kwds)
|
||||
))
|
||||
goto error;
|
||||
|
||||
struct _Ty_exc_state *state = get_exc_state();
|
||||
struct _Py_exc_state *state = get_exc_state();
|
||||
if (myerrno && TyLong_Check(myerrno) &&
|
||||
state->errnomap && (TyObject *) type == TyExc_OSError) {
|
||||
TyObject *newtype;
|
||||
@@ -2254,7 +2254,7 @@ OSError_str(TyObject *op)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
OSError_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
OSError_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyOSErrorObject *self = PyOSErrorObject_CAST(op);
|
||||
TyObject *args = self->args;
|
||||
@@ -2574,7 +2574,7 @@ AttributeError_traverse(TyObject *op, visitproc visit, void *arg)
|
||||
|
||||
/* Pickling support */
|
||||
static TyObject *
|
||||
AttributeError_getstate(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
AttributeError_getstate(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyAttributeErrorObject *self = PyAttributeErrorObject_CAST(op);
|
||||
TyObject *dict = self->dict;
|
||||
@@ -2599,11 +2599,11 @@ AttributeError_getstate(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
else if (dict) {
|
||||
return Ty_NewRef(dict);
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
AttributeError_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
AttributeError_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *state = AttributeError_getstate(op, NULL);
|
||||
if (state == NULL) {
|
||||
@@ -3967,7 +3967,7 @@ static TyObject *
|
||||
get_memory_error(int allow_allocation, TyObject *args, TyObject *kwds)
|
||||
{
|
||||
PyBaseExceptionObject *self = NULL;
|
||||
struct _Ty_exc_state *state = get_exc_state();
|
||||
struct _Py_exc_state *state = get_exc_state();
|
||||
|
||||
MEMERRORS_LOCK(state);
|
||||
if (state->memerrors_freelist != NULL) {
|
||||
@@ -4036,7 +4036,7 @@ MemoryError_dealloc(TyObject *op)
|
||||
return;
|
||||
}
|
||||
|
||||
struct _Ty_exc_state *state = get_exc_state();
|
||||
struct _Py_exc_state *state = get_exc_state();
|
||||
MEMERRORS_LOCK(state);
|
||||
if (state->memerrors_numfree < MEMERRORS_SAVE) {
|
||||
self->dict = (TyObject *) state->memerrors_freelist;
|
||||
@@ -4072,7 +4072,7 @@ preallocate_memerrors(void)
|
||||
}
|
||||
|
||||
static void
|
||||
free_preallocated_memerrors(struct _Ty_exc_state *state)
|
||||
free_preallocated_memerrors(struct _Py_exc_state *state)
|
||||
{
|
||||
while (state->memerrors_freelist != NULL) {
|
||||
TyObject *self = (TyObject *) state->memerrors_freelist;
|
||||
@@ -4385,7 +4385,7 @@ _PyExc_InitGlobalObjects(PyInterpreterState *interp)
|
||||
PyStatus
|
||||
_PyExc_InitState(PyInterpreterState *interp)
|
||||
{
|
||||
struct _Ty_exc_state *state = &interp->exc_state;
|
||||
struct _Py_exc_state *state = &interp->exc_state;
|
||||
|
||||
#define ADD_ERRNO(TYPE, CODE) \
|
||||
do { \
|
||||
@@ -4488,14 +4488,14 @@ _PyBuiltins_AddExceptions(TyObject *bltinmod)
|
||||
void
|
||||
_PyExc_ClearExceptionGroupType(PyInterpreterState *interp)
|
||||
{
|
||||
struct _Ty_exc_state *state = &interp->exc_state;
|
||||
struct _Py_exc_state *state = &interp->exc_state;
|
||||
Ty_CLEAR(state->TyExc_ExceptionGroup);
|
||||
}
|
||||
|
||||
void
|
||||
_PyExc_Fini(PyInterpreterState *interp)
|
||||
{
|
||||
struct _Ty_exc_state *state = &interp->exc_state;
|
||||
struct _Py_exc_state *state = &interp->exc_state;
|
||||
free_preallocated_memerrors(state);
|
||||
Ty_CLEAR(state->errnomap);
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ stdprinter_write(TyObject *op, TyObject *args)
|
||||
* I can't raise an exception here. It may lead to an
|
||||
* unlimited recursion in the case stderr is invalid.
|
||||
*/
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
if (!TyArg_ParseTuple(args, "U", &unicode)) {
|
||||
@@ -349,7 +349,7 @@ stdprinter_write(TyObject *op, TyObject *args)
|
||||
if (n == -1) {
|
||||
if (err == EAGAIN) {
|
||||
TyErr_Clear();
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -358,7 +358,7 @@ stdprinter_write(TyObject *op, TyObject *args)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
stdprinter_fileno(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
stdprinter_fileno(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyStdPrinter_Object *self = (PyStdPrinter_Object*)op;
|
||||
return TyLong_FromLong((long) self->fd);
|
||||
@@ -373,18 +373,18 @@ stdprinter_repr(TyObject *op)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
stdprinter_noop(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
stdprinter_noop(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
stdprinter_isatty(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
stdprinter_isatty(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyStdPrinter_Object *self = (PyStdPrinter_Object*)op;
|
||||
long res;
|
||||
if (self->fd < 0) {
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
Ty_BEGIN_ALLOW_THREADS
|
||||
@@ -404,21 +404,21 @@ static TyMethodDef stdprinter_methods[] = {
|
||||
};
|
||||
|
||||
static TyObject *
|
||||
get_closed(TyObject *self, void *Ty_UNUSED(closure))
|
||||
get_closed(TyObject *self, void *Py_UNUSED(closure))
|
||||
{
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
get_mode(TyObject *self, void *Ty_UNUSED(closure))
|
||||
get_mode(TyObject *self, void *Py_UNUSED(closure))
|
||||
{
|
||||
return TyUnicode_FromString("w");
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
get_encoding(TyObject *self, void *Ty_UNUSED(closure))
|
||||
get_encoding(TyObject *self, void *Py_UNUSED(closure))
|
||||
{
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyGetSetDef stdprinter_getsetlist[] = {
|
||||
|
||||
@@ -527,29 +527,29 @@ float_richcompare(TyObject *v, TyObject *w, int op)
|
||||
|
||||
Compare:
|
||||
switch (op) {
|
||||
case Ty_EQ:
|
||||
case Py_EQ:
|
||||
r = i == j;
|
||||
break;
|
||||
case Ty_NE:
|
||||
case Py_NE:
|
||||
r = i != j;
|
||||
break;
|
||||
case Ty_LE:
|
||||
case Py_LE:
|
||||
r = i <= j;
|
||||
break;
|
||||
case Ty_GE:
|
||||
case Py_GE:
|
||||
r = i >= j;
|
||||
break;
|
||||
case Ty_LT:
|
||||
case Py_LT:
|
||||
r = i < j;
|
||||
break;
|
||||
case Ty_GT:
|
||||
case Py_GT:
|
||||
r = i > j;
|
||||
break;
|
||||
}
|
||||
return TyBool_FromLong(r);
|
||||
|
||||
Unimplemented:
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
static Ty_hash_t
|
||||
@@ -862,7 +862,7 @@ float_is_integer_impl(TyObject *self)
|
||||
if (x == -1.0 && TyErr_Occurred())
|
||||
return NULL;
|
||||
if (!isfinite(x))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
errno = 0;
|
||||
o = (floor(x) == x) ? Ty_True : Ty_False;
|
||||
if (errno != 0) {
|
||||
@@ -1749,13 +1749,13 @@ float___getformat___impl(TyTypeObject *type, const char *typestr)
|
||||
|
||||
|
||||
static TyObject *
|
||||
float_getreal(TyObject *v, void *Ty_UNUSED(closure))
|
||||
float_getreal(TyObject *v, void *Py_UNUSED(closure))
|
||||
{
|
||||
return float_float(v);
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
float_getimag(TyObject *Ty_UNUSED(v), void *Ty_UNUSED(closure))
|
||||
float_getimag(TyObject *Py_UNUSED(v), void *Py_UNUSED(closure))
|
||||
{
|
||||
return TyFloat_FromDouble(0.0);
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ framelocalsproxy_getkeyindex(PyFrameObject *frame, TyObject *key, bool read, TyO
|
||||
if (name_hash != key_hash) {
|
||||
continue;
|
||||
}
|
||||
int same = PyObject_RichCompareBool(name, key, Ty_EQ);
|
||||
int same = PyObject_RichCompareBool(name, key, Py_EQ);
|
||||
if (same < 0) {
|
||||
return -2;
|
||||
}
|
||||
@@ -367,7 +367,7 @@ framelocalsproxy_merge(TyObject* self, TyObject* other)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
framelocalsproxy_keys(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
framelocalsproxy_keys(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyFrameObject *frame = PyFrameLocalsProxyObject_CAST(self)->frame;
|
||||
PyCodeObject *co = _TyFrame_GetCode(frame->f_frame);
|
||||
@@ -484,9 +484,9 @@ framelocalsproxy_richcompare(TyObject *lhs, TyObject *rhs, int op)
|
||||
if (PyFrameLocalsProxy_Check(rhs)) {
|
||||
PyFrameLocalsProxyObject *other = (PyFrameLocalsProxyObject *)rhs;
|
||||
bool result = self->frame == other->frame;
|
||||
if (op == Ty_EQ) {
|
||||
if (op == Py_EQ) {
|
||||
return TyBool_FromLong(result);
|
||||
} else if (op == Ty_NE) {
|
||||
} else if (op == Py_NE) {
|
||||
return TyBool_FromLong(!result);
|
||||
}
|
||||
} else if (TyDict_Check(rhs)) {
|
||||
@@ -505,7 +505,7 @@ framelocalsproxy_richcompare(TyObject *lhs, TyObject *rhs, int op)
|
||||
return result;
|
||||
}
|
||||
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -540,7 +540,7 @@ static TyObject*
|
||||
framelocalsproxy_or(TyObject *self, TyObject *other)
|
||||
{
|
||||
if (!TyDict_Check(other) && !PyFrameLocalsProxy_Check(other)) {
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
TyObject *result = TyDict_New();
|
||||
@@ -565,18 +565,18 @@ static TyObject*
|
||||
framelocalsproxy_inplace_or(TyObject *self, TyObject *other)
|
||||
{
|
||||
if (!TyDict_Check(other) && !PyFrameLocalsProxy_Check(other)) {
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
if (framelocalsproxy_merge(self, other) < 0) {
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
return Ty_NewRef(self);
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
framelocalsproxy_values(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
framelocalsproxy_values(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyFrameObject *frame = PyFrameLocalsProxyObject_CAST(self)->frame;
|
||||
PyCodeObject *co = _TyFrame_GetCode(frame->f_frame);
|
||||
@@ -614,7 +614,7 @@ framelocalsproxy_values(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
framelocalsproxy_items(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
framelocalsproxy_items(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyFrameObject *frame = PyFrameLocalsProxyObject_CAST(self)->frame;
|
||||
PyCodeObject *co = _TyFrame_GetCode(frame->f_frame);
|
||||
@@ -730,7 +730,7 @@ framelocalsproxy_update(TyObject *self, TyObject *other)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject*
|
||||
@@ -846,7 +846,7 @@ framelocalsproxy_pop(TyObject* self, TyObject *const *args, Ty_ssize_t nargs)
|
||||
}
|
||||
|
||||
static TyObject*
|
||||
framelocalsproxy_copy(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
framelocalsproxy_copy(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject* result = TyDict_New();
|
||||
|
||||
@@ -863,7 +863,7 @@ framelocalsproxy_copy(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject*
|
||||
framelocalsproxy_reversed(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
framelocalsproxy_reversed(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *result = framelocalsproxy_keys(self, NULL);
|
||||
|
||||
@@ -1019,7 +1019,7 @@ frame_lineno_get_impl(PyFrameObject *self)
|
||||
{
|
||||
int lineno = TyFrame_GetLineNumber(self);
|
||||
if (lineno < 0) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return TyLong_FromLong(lineno);
|
||||
}
|
||||
@@ -1110,7 +1110,7 @@ frame_back_get_impl(PyFrameObject *self)
|
||||
{
|
||||
TyObject *res = (TyObject *)TyFrame_GetBack(self);
|
||||
if (res == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -1889,7 +1889,7 @@ frame_generator_get_impl(PyFrameObject *self)
|
||||
TyObject *gen = (TyObject *)_TyGen_GetGeneratorFromFrame(self->f_frame);
|
||||
return Ty_NewRef(gen);
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -2009,7 +2009,7 @@ frame_clear_impl(PyFrameObject *self)
|
||||
assert(self->f_frame->owner == FRAME_OWNED_BY_FRAME_OBJECT);
|
||||
(void)frame_tp_clear((TyObject *)self);
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
running:
|
||||
TyErr_SetString(TyExc_RuntimeError,
|
||||
"cannot clear an executing frame");
|
||||
|
||||
@@ -552,7 +552,7 @@ func_get_annotation_dict(PyFunctionObject *op)
|
||||
{
|
||||
if (op->func_annotations == NULL) {
|
||||
if (op->func_annotate == NULL || !PyCallable_Check(op->func_annotate)) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
TyObject *one = _TyLong_GetOne();
|
||||
TyObject *ann_dict = _TyObject_CallOneArg(op->func_annotate, one);
|
||||
@@ -631,11 +631,11 @@ TyFunction_SetAnnotations(TyObject *op, TyObject *annotations)
|
||||
#define OFF(x) offsetof(PyFunctionObject, x)
|
||||
|
||||
static TyMemberDef func_memberlist[] = {
|
||||
{"__closure__", _Ty_T_OBJECT, OFF(func_closure), Ty_READONLY},
|
||||
{"__closure__", _Ty_T_OBJECT, OFF(func_closure), Py_READONLY},
|
||||
{"__doc__", _Ty_T_OBJECT, OFF(func_doc), 0},
|
||||
{"__globals__", _Ty_T_OBJECT, OFF(func_globals), Ty_READONLY},
|
||||
{"__globals__", _Ty_T_OBJECT, OFF(func_globals), Py_READONLY},
|
||||
{"__module__", _Ty_T_OBJECT, OFF(func_module), 0},
|
||||
{"__builtins__", _Ty_T_OBJECT, OFF(func_builtins), Ty_READONLY},
|
||||
{"__builtins__", _Ty_T_OBJECT, OFF(func_builtins), Py_READONLY},
|
||||
{NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
@@ -647,7 +647,7 @@ class function "PyFunctionObject *" "&TyFunction_Type"
|
||||
#include "clinic/funcobject.c.h"
|
||||
|
||||
static TyObject *
|
||||
func_get_code(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
func_get_code(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyFunctionObject *op = _PyFunction_CAST(self);
|
||||
if (TySys_Audit("object.__getattr__", "Os", op, "__code__") < 0) {
|
||||
@@ -658,7 +658,7 @@ func_get_code(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static int
|
||||
func_set_code(TyObject *self, TyObject *value, void *Ty_UNUSED(ignored))
|
||||
func_set_code(TyObject *self, TyObject *value, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyFunctionObject *op = _PyFunction_CAST(self);
|
||||
|
||||
@@ -707,14 +707,14 @@ func_set_code(TyObject *self, TyObject *value, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
func_get_name(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
func_get_name(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyFunctionObject *op = _PyFunction_CAST(self);
|
||||
return Ty_NewRef(op->func_name);
|
||||
}
|
||||
|
||||
static int
|
||||
func_set_name(TyObject *self, TyObject *value, void *Ty_UNUSED(ignored))
|
||||
func_set_name(TyObject *self, TyObject *value, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyFunctionObject *op = _PyFunction_CAST(self);
|
||||
/* Not legal to del f.func_name or to set it to anything
|
||||
@@ -729,14 +729,14 @@ func_set_name(TyObject *self, TyObject *value, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
func_get_qualname(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
func_get_qualname(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyFunctionObject *op = _PyFunction_CAST(self);
|
||||
return Ty_NewRef(op->func_qualname);
|
||||
}
|
||||
|
||||
static int
|
||||
func_set_qualname(TyObject *self, TyObject *value, void *Ty_UNUSED(ignored))
|
||||
func_set_qualname(TyObject *self, TyObject *value, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyFunctionObject *op = _PyFunction_CAST(self);
|
||||
/* Not legal to del f.__qualname__ or to set it to anything
|
||||
@@ -751,20 +751,20 @@ func_set_qualname(TyObject *self, TyObject *value, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
func_get_defaults(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
func_get_defaults(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyFunctionObject *op = _PyFunction_CAST(self);
|
||||
if (TySys_Audit("object.__getattr__", "Os", op, "__defaults__") < 0) {
|
||||
return NULL;
|
||||
}
|
||||
if (op->func_defaults == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return Ty_NewRef(op->func_defaults);
|
||||
}
|
||||
|
||||
static int
|
||||
func_set_defaults(TyObject *self, TyObject *value, void *Ty_UNUSED(ignored))
|
||||
func_set_defaults(TyObject *self, TyObject *value, void *Py_UNUSED(ignored))
|
||||
{
|
||||
/* Legal to del f.func_defaults.
|
||||
* Can only set func_defaults to NULL or a tuple. */
|
||||
@@ -793,7 +793,7 @@ func_set_defaults(TyObject *self, TyObject *value, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
func_get_kwdefaults(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
func_get_kwdefaults(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyFunctionObject *op = _PyFunction_CAST(self);
|
||||
if (TySys_Audit("object.__getattr__", "Os",
|
||||
@@ -801,13 +801,13 @@ func_get_kwdefaults(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
return NULL;
|
||||
}
|
||||
if (op->func_kwdefaults == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return Ty_NewRef(op->func_kwdefaults);
|
||||
}
|
||||
|
||||
static int
|
||||
func_set_kwdefaults(TyObject *self, TyObject *value, void *Ty_UNUSED(ignored))
|
||||
func_set_kwdefaults(TyObject *self, TyObject *value, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyFunctionObject *op = _PyFunction_CAST(self);
|
||||
if (value == Ty_None)
|
||||
@@ -848,7 +848,7 @@ function___annotate___get_impl(PyFunctionObject *self)
|
||||
/*[clinic end generated code: output=5ec7219ff2bda9e6 input=7f3db11e3c3329f3]*/
|
||||
{
|
||||
if (self->func_annotate == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return Ty_NewRef(self->func_annotate);
|
||||
}
|
||||
@@ -974,7 +974,7 @@ function___type_params___set_impl(PyFunctionObject *self, TyObject *value)
|
||||
}
|
||||
|
||||
TyObject *
|
||||
_Ty_set_function_type_params(PyThreadState *Ty_UNUSED(ignored), TyObject *func,
|
||||
_Ty_set_function_type_params(PyThreadState *Py_UNUSED(ignored), TyObject *func,
|
||||
TyObject *type_params)
|
||||
{
|
||||
assert(TyFunction_Check(func));
|
||||
@@ -1424,7 +1424,7 @@ typedef struct {
|
||||
|
||||
#define _PyClassMethod_CAST(cm) \
|
||||
(assert(PyObject_TypeCheck((cm), &TyClassMethod_Type)), \
|
||||
_Ty_CAST(classmethod*, cm))
|
||||
_Py_CAST(classmethod*, cm))
|
||||
|
||||
static void
|
||||
cm_dealloc(TyObject *self)
|
||||
@@ -1489,8 +1489,8 @@ cm_init(TyObject *self, TyObject *args, TyObject *kwds)
|
||||
}
|
||||
|
||||
static TyMemberDef cm_memberlist[] = {
|
||||
{"__func__", _Ty_T_OBJECT, offsetof(classmethod, cm_callable), Ty_READONLY},
|
||||
{"__wrapped__", _Ty_T_OBJECT, offsetof(classmethod, cm_callable), Ty_READONLY},
|
||||
{"__func__", _Ty_T_OBJECT, offsetof(classmethod, cm_callable), Py_READONLY},
|
||||
{"__wrapped__", _Ty_T_OBJECT, offsetof(classmethod, cm_callable), Py_READONLY},
|
||||
{NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
@@ -1503,9 +1503,9 @@ cm_get___isabstractmethod__(TyObject *self, void *closure)
|
||||
return NULL;
|
||||
}
|
||||
else if (res) {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -1658,7 +1658,7 @@ typedef struct {
|
||||
|
||||
#define _PyStaticMethod_CAST(cm) \
|
||||
(assert(PyObject_TypeCheck((cm), &TyStaticMethod_Type)), \
|
||||
_Ty_CAST(staticmethod*, cm))
|
||||
_Py_CAST(staticmethod*, cm))
|
||||
|
||||
static void
|
||||
sm_dealloc(TyObject *self)
|
||||
@@ -1727,8 +1727,8 @@ sm_call(TyObject *callable, TyObject *args, TyObject *kwargs)
|
||||
}
|
||||
|
||||
static TyMemberDef sm_memberlist[] = {
|
||||
{"__func__", _Ty_T_OBJECT, offsetof(staticmethod, sm_callable), Ty_READONLY},
|
||||
{"__wrapped__", _Ty_T_OBJECT, offsetof(staticmethod, sm_callable), Ty_READONLY},
|
||||
{"__func__", _Ty_T_OBJECT, offsetof(staticmethod, sm_callable), Py_READONLY},
|
||||
{"__wrapped__", _Ty_T_OBJECT, offsetof(staticmethod, sm_callable), Py_READONLY},
|
||||
{NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
@@ -1741,9 +1741,9 @@ sm_get___isabstractmethod__(TyObject *self, void *closure)
|
||||
return NULL;
|
||||
}
|
||||
else if (res) {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
|
||||
@@ -671,37 +671,37 @@ static TyObject *
|
||||
ga_richcompare(TyObject *a, TyObject *b, int op)
|
||||
{
|
||||
if (!_PyGenericAlias_Check(b) ||
|
||||
(op != Ty_EQ && op != Ty_NE))
|
||||
(op != Py_EQ && op != Py_NE))
|
||||
{
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
if (op == Ty_NE) {
|
||||
TyObject *eq = ga_richcompare(a, b, Ty_EQ);
|
||||
if (op == Py_NE) {
|
||||
TyObject *eq = ga_richcompare(a, b, Py_EQ);
|
||||
if (eq == NULL)
|
||||
return NULL;
|
||||
Ty_DECREF(eq);
|
||||
if (eq == Ty_True) {
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
else {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
gaobject *aa = (gaobject *)a;
|
||||
gaobject *bb = (gaobject *)b;
|
||||
if (aa->starred != bb->starred) {
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
int eq = PyObject_RichCompareBool(aa->origin, bb->origin, Ty_EQ);
|
||||
int eq = PyObject_RichCompareBool(aa->origin, bb->origin, Py_EQ);
|
||||
if (eq < 0) {
|
||||
return NULL;
|
||||
}
|
||||
if (!eq) {
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
return PyObject_RichCompare(aa->args, bb->args, Ty_EQ);
|
||||
return PyObject_RichCompare(aa->args, bb->args, Py_EQ);
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -712,7 +712,7 @@ ga_mro_entries(TyObject *self, TyObject *args)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
ga_instancecheck(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
ga_instancecheck(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyErr_SetString(TyExc_TypeError,
|
||||
"isinstance() argument 2 cannot be a parameterized generic");
|
||||
@@ -720,7 +720,7 @@ ga_instancecheck(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
ga_subclasscheck(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
ga_subclasscheck(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyErr_SetString(TyExc_TypeError,
|
||||
"issubclass() argument 2 cannot be a parameterized generic");
|
||||
@@ -728,7 +728,7 @@ ga_subclasscheck(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
ga_reduce(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
ga_reduce(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
gaobject *alias = (gaobject *)self;
|
||||
if (alias->starred) {
|
||||
@@ -746,7 +746,7 @@ ga_reduce(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
ga_dir(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
ga_dir(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
gaobject *alias = (gaobject *)self;
|
||||
TyObject *dir = PyObject_Dir(alias->origin);
|
||||
@@ -793,9 +793,9 @@ static TyMethodDef ga_methods[] = {
|
||||
};
|
||||
|
||||
static TyMemberDef ga_members[] = {
|
||||
{"__origin__", _Ty_T_OBJECT, offsetof(gaobject, origin), Ty_READONLY},
|
||||
{"__args__", _Ty_T_OBJECT, offsetof(gaobject, args), Ty_READONLY},
|
||||
{"__unpacked__", Ty_T_BOOL, offsetof(gaobject, starred), Ty_READONLY},
|
||||
{"__origin__", _Ty_T_OBJECT, offsetof(gaobject, origin), Py_READONLY},
|
||||
{"__args__", _Ty_T_OBJECT, offsetof(gaobject, args), Py_READONLY},
|
||||
{"__unpacked__", Ty_T_BOOL, offsetof(gaobject, starred), Py_READONLY},
|
||||
{0}
|
||||
};
|
||||
|
||||
@@ -819,7 +819,7 @@ ga_unpacked_tuple_args(TyObject *self, void *unused)
|
||||
if (alias->starred && alias->origin == (TyObject *)&TyTuple_Type) {
|
||||
return Ty_NewRef(alias->args);
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyGetSetDef ga_properties[] = {
|
||||
@@ -928,7 +928,7 @@ ga_iter_clear(TyObject *self)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
ga_iter_reduce(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
ga_iter_reduce(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *iter = _TyEval_GetBuiltin(&_Ty_ID(iter));
|
||||
gaiterobject *gi = (gaiterobject *)self;
|
||||
|
||||
@@ -29,12 +29,12 @@ static TyObject* async_gen_athrow_new(PyAsyncGenObject *, TyObject *);
|
||||
|
||||
|
||||
#define _TyGen_CAST(op) \
|
||||
_Ty_CAST(PyGenObject*, (op))
|
||||
_Py_CAST(PyGenObject*, (op))
|
||||
#define _PyCoroObject_CAST(op) \
|
||||
(assert(TyCoro_CheckExact(op)), \
|
||||
_Ty_CAST(PyCoroObject*, (op)))
|
||||
_Py_CAST(PyCoroObject*, (op)))
|
||||
#define _PyAsyncGenObject_CAST(op) \
|
||||
_Ty_CAST(PyAsyncGenObject*, (op))
|
||||
_Py_CAST(PyAsyncGenObject*, (op))
|
||||
|
||||
|
||||
static const char *NON_INIT_CORO_MSG = "can't send non-None value to a "
|
||||
@@ -390,10 +390,10 @@ gen_close(TyObject *self, TyObject *args)
|
||||
|
||||
if (gen->gi_frame_state == FRAME_CREATED) {
|
||||
gen->gi_frame_state = FRAME_COMPLETED;
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
if (FRAME_STATE_FINISHED(gen->gi_frame_state)) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
TyObject *yf = _TyGen_yf(gen);
|
||||
@@ -416,7 +416,7 @@ gen_close(TyObject *self, TyObject *args)
|
||||
assert((oparg & RESUME_OPARG_LOCATION_MASK) != RESUME_AT_FUNC_START);
|
||||
gen->gi_frame_state = FRAME_COMPLETED;
|
||||
gen_clear_frame(gen);
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
}
|
||||
if (err == 0) {
|
||||
@@ -439,7 +439,7 @@ gen_close(TyObject *self, TyObject *args)
|
||||
|
||||
if (TyErr_ExceptionMatches(TyExc_GeneratorExit)) {
|
||||
TyErr_Clear(); /* ignore this error */
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* if the generator returned a value while closing, StopIteration was
|
||||
@@ -701,14 +701,14 @@ gen_repr(TyObject *self)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
gen_get_name(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
gen_get_name(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyGenObject *op = _TyGen_CAST(self);
|
||||
return Ty_NewRef(op->gi_name);
|
||||
}
|
||||
|
||||
static int
|
||||
gen_set_name(TyObject *self, TyObject *value, void *Ty_UNUSED(ignored))
|
||||
gen_set_name(TyObject *self, TyObject *value, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyGenObject *op = _TyGen_CAST(self);
|
||||
/* Not legal to del gen.gi_name or to set it to anything
|
||||
@@ -723,14 +723,14 @@ gen_set_name(TyObject *self, TyObject *value, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
gen_get_qualname(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
gen_get_qualname(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyGenObject *op = _TyGen_CAST(self);
|
||||
return Ty_NewRef(op->gi_qualname);
|
||||
}
|
||||
|
||||
static int
|
||||
gen_set_qualname(TyObject *self, TyObject *value, void *Ty_UNUSED(ignored))
|
||||
gen_set_qualname(TyObject *self, TyObject *value, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyGenObject *op = _TyGen_CAST(self);
|
||||
/* Not legal to del gen.__qualname__ or to set it to anything
|
||||
@@ -745,28 +745,28 @@ gen_set_qualname(TyObject *self, TyObject *value, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
gen_getyieldfrom(TyObject *gen, void *Ty_UNUSED(ignored))
|
||||
gen_getyieldfrom(TyObject *gen, void *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *yf = _TyGen_yf(_TyGen_CAST(gen));
|
||||
if (yf == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return yf;
|
||||
}
|
||||
|
||||
|
||||
static TyObject *
|
||||
gen_getrunning(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
gen_getrunning(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyGenObject *gen = _TyGen_CAST(self);
|
||||
if (gen->gi_frame_state == FRAME_EXECUTING) {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
gen_getsuspended(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
gen_getsuspended(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyGenObject *gen = _TyGen_CAST(self);
|
||||
return TyBool_FromLong(FRAME_STATE_SUSPENDED(gen->gi_frame_state));
|
||||
@@ -779,13 +779,13 @@ _gen_getframe(PyGenObject *gen, const char *const name)
|
||||
return NULL;
|
||||
}
|
||||
if (FRAME_STATE_FINISHED(gen->gi_frame_state)) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return _Ty_XNewRef((TyObject *)_TyFrame_GetFrameObject(&gen->gi_iframe));
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
gen_getframe(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
gen_getframe(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyGenObject *gen = _TyGen_CAST(self);
|
||||
return _gen_getframe(gen, "gi_frame");
|
||||
@@ -801,7 +801,7 @@ _gen_getcode(PyGenObject *gen, const char *const name)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
gen_getcode(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
gen_getcode(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyGenObject *gen = _TyGen_CAST(self);
|
||||
return _gen_getcode(gen, "gi_code");
|
||||
@@ -826,7 +826,7 @@ static TyMemberDef gen_memberlist[] = {
|
||||
};
|
||||
|
||||
static TyObject *
|
||||
gen_sizeof(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
gen_sizeof(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyGenObject *gen = _TyGen_CAST(op);
|
||||
Ty_ssize_t res;
|
||||
@@ -1038,7 +1038,7 @@ typedef struct {
|
||||
|
||||
#define _PyCoroWrapper_CAST(op) \
|
||||
(assert(Ty_IS_TYPE((op), &_PyCoroWrapper_Type)), \
|
||||
_Ty_CAST(PyCoroWrapper*, (op)))
|
||||
_Py_CAST(PyCoroWrapper*, (op)))
|
||||
|
||||
|
||||
static int
|
||||
@@ -1123,42 +1123,42 @@ coro_await(TyObject *coro)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
coro_get_cr_await(TyObject *coro, void *Ty_UNUSED(ignored))
|
||||
coro_get_cr_await(TyObject *coro, void *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *yf = _TyGen_yf((PyGenObject *) coro);
|
||||
if (yf == NULL)
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
return yf;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
cr_getsuspended(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
cr_getsuspended(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyCoroObject *coro = _PyCoroObject_CAST(self);
|
||||
if (FRAME_STATE_SUSPENDED(coro->cr_frame_state)) {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
cr_getrunning(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
cr_getrunning(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyCoroObject *coro = _PyCoroObject_CAST(self);
|
||||
if (coro->cr_frame_state == FRAME_EXECUTING) {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
cr_getframe(TyObject *coro, void *Ty_UNUSED(ignored))
|
||||
cr_getframe(TyObject *coro, void *Py_UNUSED(ignored))
|
||||
{
|
||||
return _gen_getframe(_TyGen_CAST(coro), "cr_frame");
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
cr_getcode(TyObject *coro, void *Ty_UNUSED(ignored))
|
||||
cr_getcode(TyObject *coro, void *Py_UNUSED(ignored))
|
||||
{
|
||||
return _gen_getcode(_TyGen_CAST(coro), "cr_code");
|
||||
}
|
||||
@@ -1178,7 +1178,7 @@ static TyGetSetDef coro_getsetlist[] = {
|
||||
};
|
||||
|
||||
static TyMemberDef coro_memberlist[] = {
|
||||
{"cr_origin", _Ty_T_OBJECT, offsetof(PyCoroObject, cr_origin_or_finalizer), Ty_READONLY},
|
||||
{"cr_origin", _Ty_T_OBJECT, offsetof(PyCoroObject, cr_origin_or_finalizer), Py_READONLY},
|
||||
{NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
@@ -1442,7 +1442,7 @@ typedef struct PyAsyncGenASend {
|
||||
} PyAsyncGenASend;
|
||||
|
||||
#define _PyAsyncGenASend_CAST(op) \
|
||||
_Ty_CAST(PyAsyncGenASend*, (op))
|
||||
_Py_CAST(PyAsyncGenASend*, (op))
|
||||
|
||||
|
||||
typedef struct PyAsyncGenAThrow {
|
||||
@@ -1467,7 +1467,7 @@ typedef struct _PyAsyncGenWrappedValue {
|
||||
Ty_IS_TYPE(o, &_PyAsyncGenWrappedValue_Type)
|
||||
#define _PyAsyncGenWrappedValue_CAST(op) \
|
||||
(assert(_PyAsyncGenWrappedValue_CheckExact(op)), \
|
||||
_Ty_CAST(_PyAsyncGenWrappedValue*, (op)))
|
||||
_Py_CAST(_PyAsyncGenWrappedValue*, (op)))
|
||||
|
||||
|
||||
static int
|
||||
@@ -1576,25 +1576,25 @@ async_gen_athrow(TyObject *op, TyObject *args)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
ag_getframe(TyObject *ag, void *Ty_UNUSED(ignored))
|
||||
ag_getframe(TyObject *ag, void *Py_UNUSED(ignored))
|
||||
{
|
||||
return _gen_getframe((PyGenObject *)ag, "ag_frame");
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
ag_getcode(TyObject *gen, void *Ty_UNUSED(ignored))
|
||||
ag_getcode(TyObject *gen, void *Py_UNUSED(ignored))
|
||||
{
|
||||
return _gen_getcode((PyGenObject*)gen, "ag_code");
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
ag_getsuspended(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
ag_getsuspended(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyAsyncGenObject *ag = _PyAsyncGenObject_CAST(self);
|
||||
if (FRAME_STATE_SUSPENDED(ag->ag_frame_state)) {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
static TyGetSetDef async_gen_getsetlist[] = {
|
||||
@@ -1612,7 +1612,7 @@ static TyGetSetDef async_gen_getsetlist[] = {
|
||||
|
||||
static TyMemberDef async_gen_memberlist[] = {
|
||||
{"ag_running", Ty_T_BOOL, offsetof(PyAsyncGenObject, ag_running_async),
|
||||
Ty_READONLY},
|
||||
Py_READONLY},
|
||||
{NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
@@ -1868,7 +1868,7 @@ async_gen_asend_close(TyObject *self, TyObject *args)
|
||||
{
|
||||
PyAsyncGenASend *o = _PyAsyncGenASend_CAST(self);
|
||||
if (o->ags_state == AWAITABLE_STATE_CLOSED) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
TyObject *result = async_gen_asend_throw(self, &TyExc_GeneratorExit, 1);
|
||||
@@ -1878,7 +1878,7 @@ async_gen_asend_close(TyObject *self, TyObject *args)
|
||||
TyErr_ExceptionMatches(TyExc_GeneratorExit))
|
||||
{
|
||||
TyErr_Clear();
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -2066,7 +2066,7 @@ _PyAsyncGenValueWrapperNew(PyThreadState *tstate, TyObject *val)
|
||||
|
||||
#define _PyAsyncGenAThrow_CAST(op) \
|
||||
(assert(Ty_IS_TYPE((op), &_PyAsyncGenAThrow_Type)), \
|
||||
_Ty_CAST(PyAsyncGenAThrow*, (op)))
|
||||
_Py_CAST(PyAsyncGenAThrow*, (op)))
|
||||
|
||||
static void
|
||||
async_gen_athrow_dealloc(TyObject *self)
|
||||
@@ -2308,7 +2308,7 @@ async_gen_athrow_close(TyObject *self, TyObject *args)
|
||||
{
|
||||
PyAsyncGenAThrow *agt = _PyAsyncGenAThrow_CAST(self);
|
||||
if (agt->agt_state == AWAITABLE_STATE_CLOSED) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
TyObject *result = async_gen_athrow_throw((TyObject*)agt,
|
||||
&TyExc_GeneratorExit, 1);
|
||||
@@ -2318,7 +2318,7 @@ async_gen_athrow_close(TyObject *self, TyObject *args)
|
||||
TyErr_ExceptionMatches(TyExc_GeneratorExit))
|
||||
{
|
||||
TyErr_Clear();
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
|
||||
@@ -47,7 +47,7 @@ typedef struct {
|
||||
} interpolationobject;
|
||||
|
||||
#define interpolationobject_CAST(op) \
|
||||
(assert(_PyInterpolation_CheckExact(op)), _Ty_CAST(interpolationobject*, (op)))
|
||||
(assert(_PyInterpolation_CheckExact(op)), _Py_CAST(interpolationobject*, (op)))
|
||||
|
||||
/*[clinic input]
|
||||
@classmethod
|
||||
@@ -118,15 +118,15 @@ interpolation_repr(TyObject *op)
|
||||
}
|
||||
|
||||
static TyMemberDef interpolation_members[] = {
|
||||
{"value", Ty_T_OBJECT_EX, offsetof(interpolationobject, value), Ty_READONLY, "Value"},
|
||||
{"expression", Ty_T_OBJECT_EX, offsetof(interpolationobject, expression), Ty_READONLY, "Expression"},
|
||||
{"conversion", Ty_T_OBJECT_EX, offsetof(interpolationobject, conversion), Ty_READONLY, "Conversion"},
|
||||
{"format_spec", Ty_T_OBJECT_EX, offsetof(interpolationobject, format_spec), Ty_READONLY, "Format specifier"},
|
||||
{"value", Ty_T_OBJECT_EX, offsetof(interpolationobject, value), Py_READONLY, "Value"},
|
||||
{"expression", Ty_T_OBJECT_EX, offsetof(interpolationobject, expression), Py_READONLY, "Expression"},
|
||||
{"conversion", Ty_T_OBJECT_EX, offsetof(interpolationobject, conversion), Py_READONLY, "Conversion"},
|
||||
{"format_spec", Ty_T_OBJECT_EX, offsetof(interpolationobject, format_spec), Py_READONLY, "Format specifier"},
|
||||
{NULL}
|
||||
};
|
||||
|
||||
static TyObject*
|
||||
interpolation_reduce(TyObject *op, TyObject *Ty_UNUSED(dummy))
|
||||
interpolation_reduce(TyObject *op, TyObject *Py_UNUSED(dummy))
|
||||
{
|
||||
interpolationobject *self = interpolationobject_CAST(op);
|
||||
return Ty_BuildValue("(O(OOOO))", (TyObject *)Ty_TYPE(op),
|
||||
|
||||
@@ -83,7 +83,7 @@ iter_iternext(TyObject *iterator)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
iter_len(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
iter_len(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
seqiterobject *it = (seqiterobject*)op;
|
||||
Ty_ssize_t seqsize, len;
|
||||
@@ -95,7 +95,7 @@ iter_len(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
len = seqsize - it->it_index;
|
||||
if (len >= 0)
|
||||
@@ -107,7 +107,7 @@ iter_len(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).");
|
||||
|
||||
static TyObject *
|
||||
iter_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
iter_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
seqiterobject *it = (seqiterobject*)op;
|
||||
TyObject *iter = _TyEval_GetBuiltin(&_Ty_ID(iter));
|
||||
@@ -136,7 +136,7 @@ iter_setstate(TyObject *op, TyObject *state)
|
||||
index = 0;
|
||||
it->it_index = index;
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(setstate_doc, "Set state information for unpickling.");
|
||||
@@ -234,7 +234,7 @@ calliter_iternext(TyObject *op)
|
||||
if (result != NULL && it->it_sentinel != NULL){
|
||||
int ok;
|
||||
|
||||
ok = PyObject_RichCompareBool(it->it_sentinel, result, Ty_EQ);
|
||||
ok = PyObject_RichCompareBool(it->it_sentinel, result, Py_EQ);
|
||||
if (ok == 0) {
|
||||
return result; /* Common case, fast path */
|
||||
}
|
||||
@@ -254,7 +254,7 @@ calliter_iternext(TyObject *op)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
calliter_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
calliter_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
calliterobject *it = (calliterobject*)op;
|
||||
TyObject *iter = _TyEval_GetBuiltin(&_Ty_ID(iter));
|
||||
@@ -453,7 +453,7 @@ anextawaitable_throw(TyObject *op, TyObject *args)
|
||||
|
||||
|
||||
static TyObject *
|
||||
anextawaitable_close(TyObject *op, TyObject *Ty_UNUSED(dummy))
|
||||
anextawaitable_close(TyObject *op, TyObject *Py_UNUSED(dummy))
|
||||
{
|
||||
anextawaitableobject *obj = anextawaitableobject_CAST(op);
|
||||
return anextawaitable_proxy(obj, "close", NULL);
|
||||
|
||||
@@ -656,7 +656,7 @@ list_contains(TyObject *aa, TyObject *el)
|
||||
// out-of-bounds
|
||||
return 0;
|
||||
}
|
||||
int cmp = PyObject_RichCompareBool(item, el, Ty_EQ);
|
||||
int cmp = PyObject_RichCompareBool(item, el, Py_EQ);
|
||||
Ty_DECREF(item);
|
||||
if (cmp != 0) {
|
||||
return cmp;
|
||||
@@ -1129,7 +1129,7 @@ list_insert_impl(PyListObject *self, Ty_ssize_t index, TyObject *object)
|
||||
/*[clinic end generated code: output=7f35e32f60c8cb78 input=b1987ca998a4ae2d]*/
|
||||
{
|
||||
if (ins1(self, index, object) == 0) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -1146,7 +1146,7 @@ py_list_clear_impl(PyListObject *self)
|
||||
/*[clinic end generated code: output=83726743807e3518 input=e285b7f09051a9ba]*/
|
||||
{
|
||||
list_clear(self);
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -1180,7 +1180,7 @@ list_append_impl(PyListObject *self, TyObject *object)
|
||||
if (_TyList_AppendTakeRef(self, Ty_NewRef(object)) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1471,7 +1471,7 @@ list_extend_impl(PyListObject *self, TyObject *iterable)
|
||||
if (_list_extend(self, iterable) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
TyObject *
|
||||
@@ -2724,7 +2724,7 @@ static int
|
||||
safe_object_compare(TyObject *v, TyObject *w, MergeState *ms)
|
||||
{
|
||||
/* No assumptions necessary! */
|
||||
return PyObject_RichCompareBool(v, w, Ty_LT);
|
||||
return PyObject_RichCompareBool(v, w, Py_LT);
|
||||
}
|
||||
|
||||
/* Homogeneous compare: safe for any two comparable objects of the same type.
|
||||
@@ -2738,14 +2738,14 @@ unsafe_object_compare(TyObject *v, TyObject *w, MergeState *ms)
|
||||
|
||||
/* No assumptions, because we check first: */
|
||||
if (Ty_TYPE(v)->tp_richcompare != ms->key_richcompare)
|
||||
return PyObject_RichCompareBool(v, w, Ty_LT);
|
||||
return PyObject_RichCompareBool(v, w, Py_LT);
|
||||
|
||||
assert(ms->key_richcompare != NULL);
|
||||
res_obj = (*(ms->key_richcompare))(v, w, Ty_LT);
|
||||
res_obj = (*(ms->key_richcompare))(v, w, Py_LT);
|
||||
|
||||
if (res_obj == Ty_NotImplemented) {
|
||||
Ty_DECREF(res_obj);
|
||||
return PyObject_RichCompareBool(v, w, Ty_LT);
|
||||
return PyObject_RichCompareBool(v, w, Py_LT);
|
||||
}
|
||||
if (res_obj == NULL)
|
||||
return -1;
|
||||
@@ -2759,7 +2759,7 @@ unsafe_object_compare(TyObject *v, TyObject *w, MergeState *ms)
|
||||
Ty_DECREF(res_obj);
|
||||
|
||||
/* Note that we can't assert
|
||||
* res == PyObject_RichCompareBool(v, w, Ty_LT);
|
||||
* res == PyObject_RichCompareBool(v, w, Py_LT);
|
||||
* because of evil compare functions like this:
|
||||
* lambda a, b: int(random.random() * 3) - 1)
|
||||
* (which is actually in test_sort.py) */
|
||||
@@ -2786,7 +2786,7 @@ unsafe_latin_compare(TyObject *v, TyObject *w, MergeState *ms)
|
||||
res < 0 :
|
||||
TyUnicode_GET_LENGTH(v) < TyUnicode_GET_LENGTH(w));
|
||||
|
||||
assert(res == PyObject_RichCompareBool(v, w, Ty_LT));;
|
||||
assert(res == PyObject_RichCompareBool(v, w, Py_LT));;
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -2811,7 +2811,7 @@ unsafe_long_compare(TyObject *v, TyObject *w, MergeState *ms)
|
||||
w0 = _TyLong_CompactValue(wl);
|
||||
|
||||
res = v0 < w0;
|
||||
assert(res == PyObject_RichCompareBool(v, w, Ty_LT));
|
||||
assert(res == PyObject_RichCompareBool(v, w, Py_LT));
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -2826,7 +2826,7 @@ unsafe_float_compare(TyObject *v, TyObject *w, MergeState *ms)
|
||||
assert(Ty_IS_TYPE(w, &TyFloat_Type));
|
||||
|
||||
res = TyFloat_AS_DOUBLE(v) < TyFloat_AS_DOUBLE(w);
|
||||
assert(res == PyObject_RichCompareBool(v, w, Ty_LT));
|
||||
assert(res == PyObject_RichCompareBool(v, w, Py_LT));
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -2856,7 +2856,7 @@ unsafe_tuple_compare(TyObject *v, TyObject *w, MergeState *ms)
|
||||
wlen = Ty_SIZE(wt);
|
||||
|
||||
for (i = 0; i < vlen && i < wlen; i++) {
|
||||
k = PyObject_RichCompareBool(vt->ob_item[i], wt->ob_item[i], Ty_EQ);
|
||||
k = PyObject_RichCompareBool(vt->ob_item[i], wt->ob_item[i], Py_EQ);
|
||||
if (k < 0)
|
||||
return -1;
|
||||
if (!k)
|
||||
@@ -2869,7 +2869,7 @@ unsafe_tuple_compare(TyObject *v, TyObject *w, MergeState *ms)
|
||||
if (i == 0)
|
||||
return ms->tuple_elem_compare(vt->ob_item[i], wt->ob_item[i], ms);
|
||||
else
|
||||
return PyObject_RichCompareBool(vt->ob_item[i], wt->ob_item[i], Ty_LT);
|
||||
return PyObject_RichCompareBool(vt->ob_item[i], wt->ob_item[i], Py_LT);
|
||||
}
|
||||
|
||||
/* An adaptive, stable, natural mergesort. See listsort.txt.
|
||||
@@ -3192,7 +3192,7 @@ list_reverse_impl(PyListObject *self)
|
||||
{
|
||||
if (Ty_SIZE(self) > 1)
|
||||
reverse_slice(self->ob_item, self->ob_item + Ty_SIZE(self));
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
int
|
||||
@@ -3300,7 +3300,7 @@ list_index_impl(PyListObject *self, TyObject *value, Ty_ssize_t start,
|
||||
// out-of-bounds
|
||||
break;
|
||||
}
|
||||
int cmp = PyObject_RichCompareBool(obj, value, Ty_EQ);
|
||||
int cmp = PyObject_RichCompareBool(obj, value, Py_EQ);
|
||||
Ty_DECREF(obj);
|
||||
if (cmp > 0)
|
||||
return TyLong_FromSsize_t(i);
|
||||
@@ -3336,7 +3336,7 @@ list_count_impl(PyListObject *self, TyObject *value)
|
||||
Ty_DECREF(obj);
|
||||
continue;
|
||||
}
|
||||
int cmp = PyObject_RichCompareBool(obj, value, Ty_EQ);
|
||||
int cmp = PyObject_RichCompareBool(obj, value, Py_EQ);
|
||||
Ty_DECREF(obj);
|
||||
if (cmp > 0)
|
||||
count++;
|
||||
@@ -3367,11 +3367,11 @@ list_remove_impl(PyListObject *self, TyObject *value)
|
||||
for (i = 0; i < Ty_SIZE(self); i++) {
|
||||
TyObject *obj = self->ob_item[i];
|
||||
Ty_INCREF(obj);
|
||||
int cmp = PyObject_RichCompareBool(obj, value, Ty_EQ);
|
||||
int cmp = PyObject_RichCompareBool(obj, value, Py_EQ);
|
||||
Ty_DECREF(obj);
|
||||
if (cmp > 0) {
|
||||
if (list_ass_slice_lock_held(self, i, i+1, NULL) == 0)
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
return NULL;
|
||||
}
|
||||
else if (cmp < 0)
|
||||
@@ -3399,17 +3399,17 @@ list_richcompare_impl(TyObject *v, TyObject *w, int op)
|
||||
Ty_ssize_t i;
|
||||
|
||||
if (!TyList_Check(v) || !TyList_Check(w))
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
|
||||
vl = (PyListObject *)v;
|
||||
wl = (PyListObject *)w;
|
||||
|
||||
if (Ty_SIZE(vl) != Ty_SIZE(wl) && (op == Ty_EQ || op == Ty_NE)) {
|
||||
if (Ty_SIZE(vl) != Ty_SIZE(wl) && (op == Py_EQ || op == Py_NE)) {
|
||||
/* Shortcut: if the lengths differ, the lists differ */
|
||||
if (op == Ty_EQ)
|
||||
Ty_RETURN_FALSE;
|
||||
if (op == Py_EQ)
|
||||
Py_RETURN_FALSE;
|
||||
else
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
/* Search for the first index where items are different */
|
||||
@@ -3422,7 +3422,7 @@ list_richcompare_impl(TyObject *v, TyObject *w, int op)
|
||||
|
||||
Ty_INCREF(vitem);
|
||||
Ty_INCREF(witem);
|
||||
int k = PyObject_RichCompareBool(vitem, witem, Ty_EQ);
|
||||
int k = PyObject_RichCompareBool(vitem, witem, Py_EQ);
|
||||
Ty_DECREF(vitem);
|
||||
Ty_DECREF(witem);
|
||||
if (k < 0)
|
||||
@@ -3433,15 +3433,15 @@ list_richcompare_impl(TyObject *v, TyObject *w, int op)
|
||||
|
||||
if (i >= Ty_SIZE(vl) || i >= Ty_SIZE(wl)) {
|
||||
/* No more items to compare -- compare sizes */
|
||||
Ty_RETURN_RICHCOMPARE(Ty_SIZE(vl), Ty_SIZE(wl), op);
|
||||
Py_RETURN_RICHCOMPARE(Ty_SIZE(vl), Ty_SIZE(wl), op);
|
||||
}
|
||||
|
||||
/* We have an item that differs -- shortcuts for EQ/NE */
|
||||
if (op == Ty_EQ) {
|
||||
Ty_RETURN_FALSE;
|
||||
if (op == Py_EQ) {
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
if (op == Ty_NE) {
|
||||
Ty_RETURN_TRUE;
|
||||
if (op == Py_NE) {
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
/* Compare the final item again using the proper operator */
|
||||
@@ -4033,7 +4033,7 @@ listiter_next(TyObject *self)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
listiter_len(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
listiter_len(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
assert(self != NULL);
|
||||
_PyListIterObject *it = (_PyListIterObject *)self;
|
||||
@@ -4047,7 +4047,7 @@ listiter_len(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
listiter_reduce(TyObject *it, TyObject *Ty_UNUSED(ignored))
|
||||
listiter_reduce(TyObject *it, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return listiter_reduce_general(it, 1);
|
||||
}
|
||||
@@ -4066,7 +4066,7 @@ listiter_setstate(TyObject *self, TyObject *state)
|
||||
index = TyList_GET_SIZE(it->it_seq); /* iterator exhausted */
|
||||
FT_ATOMIC_STORE_SSIZE_RELAXED(it->it_index, index);
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/*********************** List Reverse Iterator **************************/
|
||||
@@ -4188,7 +4188,7 @@ listreviter_next(TyObject *self)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
listreviter_len(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
listreviter_len(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
listreviterobject *it = (listreviterobject *)self;
|
||||
Ty_ssize_t index = FT_ATOMIC_LOAD_SSIZE_RELAXED(it->it_index);
|
||||
@@ -4199,7 +4199,7 @@ listreviter_len(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
listreviter_reduce(TyObject *it, TyObject *Ty_UNUSED(ignored))
|
||||
listreviter_reduce(TyObject *it, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return listiter_reduce_general(it, 0);
|
||||
}
|
||||
@@ -4218,7 +4218,7 @@ listreviter_setstate(TyObject *self, TyObject *state)
|
||||
index = TyList_GET_SIZE(it->it_seq) - 1;
|
||||
FT_ATOMIC_STORE_SSIZE_RELAXED(it->it_index, index);
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* common pickling support */
|
||||
|
||||
@@ -1132,7 +1132,7 @@ memoryview_release_impl(PyMemoryViewObject *self)
|
||||
Ty_ssize_t exports = get_exports(self);
|
||||
if (exports == 0) {
|
||||
_memory_release(self);
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
if (exports > 0) {
|
||||
@@ -2801,7 +2801,7 @@ memoryview_count_impl(PyMemoryViewObject *self, TyObject *value)
|
||||
count++; // no overflow since count <= len(mv) <= PY_SSIZE_T_MAX
|
||||
continue;
|
||||
}
|
||||
int contained = PyObject_RichCompareBool(item, value, Ty_EQ);
|
||||
int contained = PyObject_RichCompareBool(item, value, Py_EQ);
|
||||
Ty_DECREF(item);
|
||||
if (contained > 0) { // more likely than 'contained < 0'
|
||||
count++; // no overflow since count <= len(mv) <= PY_SSIZE_T_MAX
|
||||
@@ -2881,7 +2881,7 @@ memoryview_index_impl(PyMemoryViewObject *self, TyObject *value,
|
||||
Ty_DECREF(item);
|
||||
return TyLong_FromSsize_t(index);
|
||||
}
|
||||
int contained = PyObject_RichCompareBool(item, value, Ty_EQ);
|
||||
int contained = PyObject_RichCompareBool(item, value, Py_EQ);
|
||||
Ty_DECREF(item);
|
||||
if (contained > 0) { // more likely than 'contained < 0'
|
||||
return TyLong_FromSsize_t(index);
|
||||
@@ -2945,7 +2945,7 @@ struct_unpack_cmp(const char *p, const char *q,
|
||||
}
|
||||
|
||||
/* MV_COMPARE_EX == -1: exceptions are preserved */
|
||||
ret = PyObject_RichCompareBool(v, w, Ty_EQ);
|
||||
ret = PyObject_RichCompareBool(v, w, Py_EQ);
|
||||
Ty_DECREF(v);
|
||||
Ty_DECREF(w);
|
||||
|
||||
@@ -3103,7 +3103,7 @@ memory_richcompare(TyObject *v, TyObject *w, int op)
|
||||
char vfmt, wfmt;
|
||||
int equal = MV_COMPARE_NOT_IMPL;
|
||||
|
||||
if (op != Ty_EQ && op != Ty_NE)
|
||||
if (op != Py_EQ && op != Py_NE)
|
||||
goto result; /* Ty_NotImplemented */
|
||||
|
||||
assert(TyMemoryView_Check(v));
|
||||
@@ -3181,7 +3181,7 @@ result:
|
||||
else /* exception */
|
||||
res = NULL;
|
||||
}
|
||||
else if ((equal && op == Ty_EQ) || (!equal && op == Ty_NE))
|
||||
else if ((equal && op == Py_EQ) || (!equal && op == Py_NE))
|
||||
res = Ty_True;
|
||||
else
|
||||
res = Ty_False;
|
||||
@@ -3279,20 +3279,20 @@ _IntTupleFromSsizet(int len, Ty_ssize_t *vals)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
memory_obj_get(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
memory_obj_get(TyObject *_self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyMemoryViewObject *self = (PyMemoryViewObject *)_self;
|
||||
Ty_buffer *view = &self->view;
|
||||
|
||||
CHECK_RELEASED(self);
|
||||
if (view->obj == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return Ty_NewRef(view->obj);
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
memory_nbytes_get(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
memory_nbytes_get(TyObject *_self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyMemoryViewObject *self = (PyMemoryViewObject *)_self;
|
||||
CHECK_RELEASED(self);
|
||||
@@ -3300,7 +3300,7 @@ memory_nbytes_get(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
memory_format_get(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
memory_format_get(TyObject *_self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyMemoryViewObject *self = (PyMemoryViewObject *)_self;
|
||||
CHECK_RELEASED(self);
|
||||
@@ -3308,7 +3308,7 @@ memory_format_get(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
memory_itemsize_get(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
memory_itemsize_get(TyObject *_self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyMemoryViewObject *self = (PyMemoryViewObject *)_self;
|
||||
CHECK_RELEASED(self);
|
||||
@@ -3316,7 +3316,7 @@ memory_itemsize_get(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
memory_shape_get(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
memory_shape_get(TyObject *_self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyMemoryViewObject *self = (PyMemoryViewObject *)_self;
|
||||
CHECK_RELEASED(self);
|
||||
@@ -3324,7 +3324,7 @@ memory_shape_get(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
memory_strides_get(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
memory_strides_get(TyObject *_self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyMemoryViewObject *self = (PyMemoryViewObject *)_self;
|
||||
CHECK_RELEASED(self);
|
||||
@@ -3332,7 +3332,7 @@ memory_strides_get(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
memory_suboffsets_get(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
memory_suboffsets_get(TyObject *_self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyMemoryViewObject *self = (PyMemoryViewObject *)_self;
|
||||
CHECK_RELEASED(self);
|
||||
@@ -3340,7 +3340,7 @@ memory_suboffsets_get(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
memory_readonly_get(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
memory_readonly_get(TyObject *_self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyMemoryViewObject *self = (PyMemoryViewObject *)_self;
|
||||
CHECK_RELEASED(self);
|
||||
@@ -3348,7 +3348,7 @@ memory_readonly_get(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
memory_ndim_get(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
memory_ndim_get(TyObject *_self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyMemoryViewObject *self = (PyMemoryViewObject *)_self;
|
||||
CHECK_RELEASED(self);
|
||||
@@ -3356,7 +3356,7 @@ memory_ndim_get(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
memory_c_contiguous(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
memory_c_contiguous(TyObject *_self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyMemoryViewObject *self = (PyMemoryViewObject *)_self;
|
||||
CHECK_RELEASED(self);
|
||||
@@ -3364,7 +3364,7 @@ memory_c_contiguous(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
memory_f_contiguous(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
memory_f_contiguous(TyObject *_self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyMemoryViewObject *self = (PyMemoryViewObject *)_self;
|
||||
CHECK_RELEASED(self);
|
||||
@@ -3372,7 +3372,7 @@ memory_f_contiguous(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
memory_contiguous(TyObject *_self, void *Ty_UNUSED(ignored))
|
||||
memory_contiguous(TyObject *_self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyMemoryViewObject *self = (PyMemoryViewObject *)_self;
|
||||
CHECK_RELEASED(self);
|
||||
|
||||
@@ -189,7 +189,7 @@ meth_dealloc(TyObject *self)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
meth_reduce(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
meth_reduce(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyCFunctionObject *m = _PyCFunctionObject_CAST(self);
|
||||
if (m->m_self == NULL || TyModule_Check(m->m_self))
|
||||
@@ -321,18 +321,18 @@ meth_richcompare(TyObject *self, TyObject *other, int op)
|
||||
TyObject *res;
|
||||
int eq;
|
||||
|
||||
if ((op != Ty_EQ && op != Ty_NE) ||
|
||||
if ((op != Py_EQ && op != Py_NE) ||
|
||||
!PyCFunction_Check(self) ||
|
||||
!PyCFunction_Check(other))
|
||||
{
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
a = (PyCFunctionObject *)self;
|
||||
b = (PyCFunctionObject *)other;
|
||||
eq = a->m_self == b->m_self;
|
||||
if (eq)
|
||||
eq = a->m_ml->ml_meth == b->m_ml->ml_meth;
|
||||
if (op == Ty_EQ)
|
||||
if (op == Py_EQ)
|
||||
res = eq ? Ty_True : Ty_False;
|
||||
else
|
||||
res = eq ? Ty_False : Ty_True;
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
|
||||
|
||||
#define _TyModule_CAST(op) \
|
||||
(assert(TyModule_Check(op)), _Ty_CAST(PyModuleObject*, (op)))
|
||||
(assert(TyModule_Check(op)), _Py_CAST(PyModuleObject*, (op)))
|
||||
|
||||
|
||||
static TyMemberDef module_members[] = {
|
||||
{"__dict__", _Ty_T_OBJECT, offsetof(PyModuleObject, md_dict), Ty_READONLY},
|
||||
{"__dict__", _Ty_T_OBJECT, offsetof(PyModuleObject, md_dict), Py_READONLY},
|
||||
{0}
|
||||
};
|
||||
|
||||
@@ -618,7 +618,7 @@ _TyModule_GetFilenameObject(TyObject *mod)
|
||||
TyObject *dict = ((PyModuleObject *)mod)->md_dict; // borrowed reference
|
||||
if (dict == NULL) {
|
||||
// The module has been tampered with.
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
TyObject *fileobj;
|
||||
int res = TyDict_GetItemRef(dict, &_Ty_ID(__file__), &fileobj);
|
||||
@@ -632,11 +632,11 @@ _TyModule_GetFilenameObject(TyObject *mod)
|
||||
// it's a namespace package or other module with a loader that
|
||||
// isn't disk-based. It could also be that a user created
|
||||
// a module manually but without manually setting __file__.
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
if (!TyUnicode_Check(fileobj)) {
|
||||
Ty_DECREF(fileobj);
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return fileobj;
|
||||
}
|
||||
@@ -1230,7 +1230,7 @@ module_get_dict(PyModuleObject *m)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
module_get_annotate(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
module_get_annotate(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyModuleObject *m = _TyModule_CAST(self);
|
||||
|
||||
@@ -1251,7 +1251,7 @@ module_get_annotate(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static int
|
||||
module_set_annotate(TyObject *self, TyObject *value, void *Ty_UNUSED(ignored))
|
||||
module_set_annotate(TyObject *self, TyObject *value, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyModuleObject *m = _TyModule_CAST(self);
|
||||
if (value == NULL) {
|
||||
@@ -1285,7 +1285,7 @@ module_set_annotate(TyObject *self, TyObject *value, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
module_get_annotations(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
module_get_annotations(TyObject *self, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyModuleObject *m = _TyModule_CAST(self);
|
||||
|
||||
@@ -1356,7 +1356,7 @@ module_get_annotations(TyObject *self, void *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static int
|
||||
module_set_annotations(TyObject *self, TyObject *value, void *Ty_UNUSED(ignored))
|
||||
module_set_annotations(TyObject *self, TyObject *value, void *Py_UNUSED(ignored))
|
||||
{
|
||||
PyModuleObject *m = _TyModule_CAST(self);
|
||||
|
||||
|
||||
@@ -12,11 +12,11 @@ typedef struct {
|
||||
TyObject *ns_dict;
|
||||
} _PyNamespaceObject;
|
||||
|
||||
#define _PyNamespace_CAST(op) _Ty_CAST(_PyNamespaceObject*, (op))
|
||||
#define _PyNamespace_CAST(op) _Py_CAST(_PyNamespaceObject*, (op))
|
||||
|
||||
|
||||
static TyMemberDef namespace_members[] = {
|
||||
{"__dict__", _Ty_T_OBJECT, offsetof(_PyNamespaceObject, ns_dict), Ty_READONLY},
|
||||
{"__dict__", _Ty_T_OBJECT, offsetof(_PyNamespaceObject, ns_dict), Py_READONLY},
|
||||
{NULL}
|
||||
};
|
||||
|
||||
@@ -198,14 +198,14 @@ namespace_richcompare(TyObject *self, TyObject *other, int op)
|
||||
PyObject_TypeCheck(other, &_PyNamespace_Type))
|
||||
return PyObject_RichCompare(((_PyNamespaceObject *)self)->ns_dict,
|
||||
((_PyNamespaceObject *)other)->ns_dict, op);
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
PyDoc_STRVAR(namespace_reduce__doc__, "Return state information for pickling");
|
||||
|
||||
static TyObject *
|
||||
namespace_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
namespace_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
_PyNamespaceObject *ns = (_PyNamespaceObject*)op;
|
||||
TyObject *result, *args = TyTuple_New(0);
|
||||
|
||||
@@ -982,7 +982,7 @@ _TyObject_FunctionStr(TyObject *x)
|
||||
TyObject *result = NULL;
|
||||
ret = PyObject_GetOptionalAttr(x, &_Ty_ID(__module__), &module);
|
||||
if (module != NULL && module != Ty_None) {
|
||||
ret = PyObject_RichCompareBool(module, &_Ty_ID(builtins), Ty_NE);
|
||||
ret = PyObject_RichCompareBool(module, &_Ty_ID(builtins), Py_NE);
|
||||
if (ret < 0) {
|
||||
// error
|
||||
goto done;
|
||||
@@ -1033,7 +1033,7 @@ done:
|
||||
*/
|
||||
|
||||
/* Map rich comparison operators to their swapped version, e.g. LT <--> GT */
|
||||
int _Ty_SwappedOp[] = {Ty_GT, Ty_GE, Ty_EQ, Ty_NE, Ty_LT, Ty_LE};
|
||||
int _Ty_SwappedOp[] = {Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE};
|
||||
|
||||
static const char * const opstrings[] = {"<", "<=", "==", "!=", ">", ">="};
|
||||
|
||||
@@ -1070,10 +1070,10 @@ do_richcompare(PyThreadState *tstate, TyObject *v, TyObject *w, int op)
|
||||
/* If neither object implements it, provide a sensible default
|
||||
for == and !=, but raise an exception for ordering. */
|
||||
switch (op) {
|
||||
case Ty_EQ:
|
||||
case Py_EQ:
|
||||
res = (v == w) ? Ty_True : Ty_False;
|
||||
break;
|
||||
case Ty_NE:
|
||||
case Py_NE:
|
||||
res = (v != w) ? Ty_True : Ty_False;
|
||||
break;
|
||||
default:
|
||||
@@ -1095,7 +1095,7 @@ PyObject_RichCompare(TyObject *v, TyObject *w, int op)
|
||||
{
|
||||
PyThreadState *tstate = _TyThreadState_GET();
|
||||
|
||||
assert(Ty_LT <= op && op <= Ty_GE);
|
||||
assert(Py_LT <= op && op <= Py_GE);
|
||||
if (v == NULL || w == NULL) {
|
||||
if (!_TyErr_Occurred(tstate)) {
|
||||
TyErr_BadInternalCall();
|
||||
@@ -1121,9 +1121,9 @@ PyObject_RichCompareBool(TyObject *v, TyObject *w, int op)
|
||||
/* Quick result when objects are the same.
|
||||
Guarantees that identity implies equality. */
|
||||
if (v == w) {
|
||||
if (op == Ty_EQ)
|
||||
if (op == Py_EQ)
|
||||
return 1;
|
||||
else if (op == Ty_NE)
|
||||
else if (op == Py_NE)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2082,7 +2082,7 @@ none_new(TyTypeObject *type, TyObject *args, TyObject *kwargs)
|
||||
TyErr_SetString(TyExc_TypeError, "NoneType takes no arguments");
|
||||
return NULL;
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -2191,7 +2191,7 @@ NotImplemented_repr(TyObject *op)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
NotImplemented_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
NotImplemented_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return TyUnicode_FromString("NotImplemented");
|
||||
}
|
||||
@@ -2208,7 +2208,7 @@ notimplemented_new(TyTypeObject *type, TyObject *args, TyObject *kwargs)
|
||||
TyErr_SetString(TyExc_TypeError, "NotImplementedType takes no arguments");
|
||||
return NULL;
|
||||
}
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -52,7 +52,7 @@ static void set_allocator_unlocked(PyMemAllocatorDomain, PyMemAllocatorEx *);
|
||||
/* the default raw allocator (wraps malloc) */
|
||||
|
||||
void *
|
||||
_TyMem_RawMalloc(void *Ty_UNUSED(ctx), size_t size)
|
||||
_TyMem_RawMalloc(void *Py_UNUSED(ctx), size_t size)
|
||||
{
|
||||
/* TyMem_RawMalloc(0) means malloc(1). Some systems would return NULL
|
||||
for malloc(0), which would be treated as an error. Some platforms would
|
||||
@@ -64,7 +64,7 @@ _TyMem_RawMalloc(void *Ty_UNUSED(ctx), size_t size)
|
||||
}
|
||||
|
||||
void *
|
||||
_TyMem_RawCalloc(void *Ty_UNUSED(ctx), size_t nelem, size_t elsize)
|
||||
_TyMem_RawCalloc(void *Py_UNUSED(ctx), size_t nelem, size_t elsize)
|
||||
{
|
||||
/* TyMem_RawCalloc(0, 0) means calloc(1, 1). Some systems would return NULL
|
||||
for calloc(0, 0), which would be treated as an error. Some platforms
|
||||
@@ -78,7 +78,7 @@ _TyMem_RawCalloc(void *Ty_UNUSED(ctx), size_t nelem, size_t elsize)
|
||||
}
|
||||
|
||||
void *
|
||||
_TyMem_RawRealloc(void *Ty_UNUSED(ctx), void *ptr, size_t size)
|
||||
_TyMem_RawRealloc(void *Py_UNUSED(ctx), void *ptr, size_t size)
|
||||
{
|
||||
if (size == 0)
|
||||
size = 1;
|
||||
@@ -86,7 +86,7 @@ _TyMem_RawRealloc(void *Ty_UNUSED(ctx), void *ptr, size_t size)
|
||||
}
|
||||
|
||||
void
|
||||
_TyMem_RawFree(void *Ty_UNUSED(ctx), void *ptr)
|
||||
_TyMem_RawFree(void *Py_UNUSED(ctx), void *ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
@@ -455,7 +455,7 @@ _TyMem_DefaultRawWcsdup(const wchar_t *str)
|
||||
#endif
|
||||
|
||||
void *
|
||||
_TyMem_ArenaAlloc(void *Ty_UNUSED(ctx), size_t size)
|
||||
_TyMem_ArenaAlloc(void *Py_UNUSED(ctx), size_t size)
|
||||
{
|
||||
#ifdef MS_WINDOWS
|
||||
return VirtualAlloc(NULL, size,
|
||||
@@ -474,11 +474,11 @@ _TyMem_ArenaAlloc(void *Ty_UNUSED(ctx), size_t size)
|
||||
}
|
||||
|
||||
void
|
||||
_TyMem_ArenaFree(void *Ty_UNUSED(ctx), void *ptr,
|
||||
_TyMem_ArenaFree(void *Py_UNUSED(ctx), void *ptr,
|
||||
#if defined(ARENAS_USE_MMAP)
|
||||
size_t size
|
||||
#else
|
||||
size_t Ty_UNUSED(size)
|
||||
size_t Py_UNUSED(size)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
@@ -1998,7 +1998,7 @@ new_arena(OMState *state)
|
||||
pymalloc. When the radix tree is used, 'poolp' is unused.
|
||||
*/
|
||||
static bool
|
||||
address_in_range(OMState *state, void *p, poolp Ty_UNUSED(pool))
|
||||
address_in_range(OMState *state, void *p, poolp Py_UNUSED(pool))
|
||||
{
|
||||
return arena_map_is_used(state, p);
|
||||
}
|
||||
@@ -2259,7 +2259,7 @@ allocate_from_new_pool(OMState *state, uint size)
|
||||
or when the max memory limit has been reached.
|
||||
*/
|
||||
static inline void*
|
||||
pymalloc_alloc(OMState *state, void *Ty_UNUSED(ctx), size_t nbytes)
|
||||
pymalloc_alloc(OMState *state, void *Py_UNUSED(ctx), size_t nbytes)
|
||||
{
|
||||
#ifdef WITH_VALGRIND
|
||||
if (UNLIKELY(running_on_valgrind == -1)) {
|
||||
@@ -2531,7 +2531,7 @@ insert_to_freepool(OMState *state, poolp pool)
|
||||
Return 1 if it was freed.
|
||||
Return 0 if the block was not allocated by pymalloc_alloc(). */
|
||||
static inline int
|
||||
pymalloc_free(OMState *state, void *Ty_UNUSED(ctx), void *p)
|
||||
pymalloc_free(OMState *state, void *Py_UNUSED(ctx), void *p)
|
||||
{
|
||||
assert(p != NULL);
|
||||
|
||||
@@ -2700,7 +2700,7 @@ _TyObject_Realloc(void *ctx, void *ptr, size_t nbytes)
|
||||
* only be used by extensions that are compiled with pymalloc enabled. */
|
||||
|
||||
Ty_ssize_t
|
||||
_TyInterpreterState_GetAllocatedBlocks(PyInterpreterState *Ty_UNUSED(interp))
|
||||
_TyInterpreterState_GetAllocatedBlocks(PyInterpreterState *Py_UNUSED(interp))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -2712,13 +2712,13 @@ _Ty_GetGlobalAllocatedBlocks(void)
|
||||
}
|
||||
|
||||
void
|
||||
_TyInterpreterState_FinalizeAllocatedBlocks(PyInterpreterState *Ty_UNUSED(interp))
|
||||
_TyInterpreterState_FinalizeAllocatedBlocks(PyInterpreterState *Py_UNUSED(interp))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
_Ty_FinalizeAllocatedBlocks(_PyRuntimeState *Ty_UNUSED(runtime))
|
||||
_Ty_FinalizeAllocatedBlocks(_PyRuntimeState *Py_UNUSED(runtime))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -502,7 +502,7 @@ struct _odictobject {
|
||||
TyObject *od_weakreflist; /* holds weakrefs to the odict */
|
||||
};
|
||||
|
||||
#define _PyODictObject_CAST(op) _Ty_CAST(PyODictObject*, (op))
|
||||
#define _PyODictObject_CAST(op) _Py_CAST(PyODictObject*, (op))
|
||||
|
||||
|
||||
/* ----------------------------------------------
|
||||
@@ -829,7 +829,7 @@ _odict_keys_equal(PyODictObject *a, PyODictObject *b)
|
||||
else {
|
||||
TyObject *key_a = Ty_NewRef(_odictnode_KEY(node_a));
|
||||
TyObject *key_b = Ty_NewRef(_odictnode_KEY(node_b));
|
||||
int res = PyObject_RichCompareBool(key_a, key_b, Ty_EQ);
|
||||
int res = PyObject_RichCompareBool(key_a, key_b, Py_EQ);
|
||||
Ty_DECREF(key_a);
|
||||
Ty_DECREF(key_b);
|
||||
if (res < 0) {
|
||||
@@ -898,7 +898,7 @@ odict_or(TyObject *left, TyObject *right)
|
||||
other = left;
|
||||
}
|
||||
if (!TyDict_Check(other)) {
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
TyObject *new = PyObject_CallOneArg((TyObject*)type, left);
|
||||
if (!new) {
|
||||
@@ -957,7 +957,7 @@ OrderedDict_fromkeys_impl(TyTypeObject *type, TyObject *seq, TyObject *value)
|
||||
PyDoc_STRVAR(odict_sizeof__doc__, "");
|
||||
|
||||
static TyObject *
|
||||
odict_sizeof(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
odict_sizeof(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyODictObject *od = _PyODictObject_CAST(op);
|
||||
Ty_ssize_t res = _TyDict_SizeOf((PyDictObject *)od);
|
||||
@@ -973,7 +973,7 @@ odict_sizeof(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
PyDoc_STRVAR(odict_reduce__doc__, "Return state information for pickling");
|
||||
|
||||
static TyObject *
|
||||
odict_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
odict_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
register PyODictObject *od = _PyODictObject_CAST(op);
|
||||
TyObject *state, *result = NULL;
|
||||
@@ -1166,21 +1166,21 @@ OrderedDict_popitem_impl(PyODictObject *self, int last)
|
||||
/* MutableMapping.keys() does not have a docstring. */
|
||||
PyDoc_STRVAR(odict_keys__doc__, "");
|
||||
|
||||
static TyObject * odictkeys_new(TyObject *od, TyObject *Ty_UNUSED(ignored)); /* forward */
|
||||
static TyObject * odictkeys_new(TyObject *od, TyObject *Py_UNUSED(ignored)); /* forward */
|
||||
|
||||
/* values() */
|
||||
|
||||
/* MutableMapping.values() does not have a docstring. */
|
||||
PyDoc_STRVAR(odict_values__doc__, "");
|
||||
|
||||
static TyObject * odictvalues_new(TyObject *od, TyObject *Ty_UNUSED(ignored)); /* forward */
|
||||
static TyObject * odictvalues_new(TyObject *od, TyObject *Py_UNUSED(ignored)); /* forward */
|
||||
|
||||
/* items() */
|
||||
|
||||
/* MutableMapping.items() does not have a docstring. */
|
||||
PyDoc_STRVAR(odict_items__doc__, "");
|
||||
|
||||
static TyObject * odictitems_new(TyObject *od, TyObject *Ty_UNUSED(ignored)); /* forward */
|
||||
static TyObject * odictitems_new(TyObject *od, TyObject *Py_UNUSED(ignored)); /* forward */
|
||||
|
||||
/* update() */
|
||||
|
||||
@@ -1198,12 +1198,12 @@ PyDoc_STRVAR(odict_clear__doc__,
|
||||
"od.clear() -> None. Remove all items from od.");
|
||||
|
||||
static TyObject *
|
||||
odict_clear(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
odict_clear(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
register PyODictObject *od = _PyODictObject_CAST(op);
|
||||
TyDict_Clear(op);
|
||||
_odict_clear_nodes(od);
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* copy() */
|
||||
@@ -1215,7 +1215,7 @@ static int _PyODict_SetItem_KnownHash(TyObject *, TyObject *, TyObject *,
|
||||
PyDoc_STRVAR(odict_copy__doc__, "od.copy() -> a shallow copy of od");
|
||||
|
||||
static TyObject *
|
||||
odict_copy(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
odict_copy(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
register PyODictObject *od = _PyODictObject_CAST(op);
|
||||
_ODictNode *node;
|
||||
@@ -1276,7 +1276,7 @@ PyDoc_STRVAR(odict_reversed__doc__, "od.__reversed__() <==> reversed(od)");
|
||||
static TyObject * odictiter_new(PyODictObject *, int);
|
||||
|
||||
static TyObject *
|
||||
odict_reversed(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
odict_reversed(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyODictObject *od = _PyODictObject_CAST(op);
|
||||
return odictiter_new(od, _odict_ITER_KEYS|_odict_ITER_REVERSED);
|
||||
@@ -1329,7 +1329,7 @@ OrderedDict_move_to_end_impl(PyODictObject *self, TyObject *key, int last)
|
||||
}
|
||||
}
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1468,10 +1468,10 @@ static TyObject *
|
||||
odict_richcompare(TyObject *v, TyObject *w, int op)
|
||||
{
|
||||
if (!PyODict_Check(v) || !TyDict_Check(w)) {
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
if (op == Ty_EQ || op == Ty_NE) {
|
||||
if (op == Py_EQ || op == Py_NE) {
|
||||
TyObject *res, *cmp;
|
||||
int eq;
|
||||
|
||||
@@ -1480,9 +1480,9 @@ odict_richcompare(TyObject *v, TyObject *w, int op)
|
||||
return NULL;
|
||||
if (!PyODict_Check(w))
|
||||
return cmp;
|
||||
if (op == Ty_EQ && cmp == Ty_False)
|
||||
if (op == Py_EQ && cmp == Ty_False)
|
||||
return cmp;
|
||||
if (op == Ty_NE && cmp == Ty_True)
|
||||
if (op == Py_NE && cmp == Ty_True)
|
||||
return cmp;
|
||||
Ty_DECREF(cmp);
|
||||
|
||||
@@ -1491,10 +1491,10 @@ odict_richcompare(TyObject *v, TyObject *w, int op)
|
||||
if (eq < 0)
|
||||
return NULL;
|
||||
|
||||
res = (eq == (op == Ty_EQ)) ? Ty_True : Ty_False;
|
||||
res = (eq == (op == Py_EQ)) ? Ty_True : Ty_False;
|
||||
return Ty_NewRef(res);
|
||||
} else {
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1786,7 +1786,7 @@ done:
|
||||
PyDoc_STRVAR(reduce_doc, "Return state information for pickling");
|
||||
|
||||
static TyObject *
|
||||
odictiter_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
odictiter_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
odictiterobject *di = (odictiterobject*)op;
|
||||
|
||||
@@ -1883,18 +1883,18 @@ odictkeys_iter(TyObject *op)
|
||||
{
|
||||
_PyDictViewObject *dv = (_PyDictViewObject*)op;
|
||||
if (dv->dv_dict == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return odictiter_new(_PyODictObject_CAST(dv->dv_dict),
|
||||
_odict_ITER_KEYS);
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
odictkeys_reversed(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
odictkeys_reversed(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
_PyDictViewObject *dv = (_PyDictViewObject*)op;
|
||||
if (dv->dv_dict == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return odictiter_new(_PyODictObject_CAST(dv->dv_dict),
|
||||
_odict_ITER_KEYS|_odict_ITER_REVERSED);
|
||||
@@ -1940,7 +1940,7 @@ TyTypeObject PyODictKeys_Type = {
|
||||
};
|
||||
|
||||
static TyObject *
|
||||
odictkeys_new(TyObject *od, TyObject *Ty_UNUSED(ignored))
|
||||
odictkeys_new(TyObject *od, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _PyDictView_New(od, &PyODictKeys_Type);
|
||||
}
|
||||
@@ -1952,18 +1952,18 @@ odictitems_iter(TyObject *op)
|
||||
{
|
||||
_PyDictViewObject *dv = (_PyDictViewObject*)op;
|
||||
if (dv->dv_dict == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return odictiter_new(_PyODictObject_CAST(dv->dv_dict),
|
||||
_odict_ITER_KEYS|_odict_ITER_VALUES);
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
odictitems_reversed(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
odictitems_reversed(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
_PyDictViewObject *dv = (_PyDictViewObject*)op;
|
||||
if (dv->dv_dict == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return odictiter_new(_PyODictObject_CAST(dv->dv_dict),
|
||||
_odict_ITER_KEYS|_odict_ITER_VALUES|_odict_ITER_REVERSED);
|
||||
@@ -2009,7 +2009,7 @@ TyTypeObject PyODictItems_Type = {
|
||||
};
|
||||
|
||||
static TyObject *
|
||||
odictitems_new(TyObject *od, TyObject *Ty_UNUSED(ignored))
|
||||
odictitems_new(TyObject *od, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _PyDictView_New(od, &PyODictItems_Type);
|
||||
}
|
||||
@@ -2021,18 +2021,18 @@ odictvalues_iter(TyObject *op)
|
||||
{
|
||||
_PyDictViewObject *dv = (_PyDictViewObject*)op;
|
||||
if (dv->dv_dict == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return odictiter_new(_PyODictObject_CAST(dv->dv_dict),
|
||||
_odict_ITER_VALUES);
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
odictvalues_reversed(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
odictvalues_reversed(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
_PyDictViewObject *dv = (_PyDictViewObject*)op;
|
||||
if (dv->dv_dict == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return odictiter_new(_PyODictObject_CAST(dv->dv_dict),
|
||||
_odict_ITER_VALUES|_odict_ITER_REVERSED);
|
||||
@@ -2078,7 +2078,7 @@ TyTypeObject PyODictValues_Type = {
|
||||
};
|
||||
|
||||
static TyObject *
|
||||
odictvalues_new(TyObject *od, TyObject *Ty_UNUSED(ignored))
|
||||
odictvalues_new(TyObject *od, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _PyDictView_New(od, &PyODictValues_Type);
|
||||
}
|
||||
@@ -2288,5 +2288,5 @@ mutablemapping_update(TyObject *self, TyObject *args, TyObject *kwargs)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ static PyBufferProcs picklebuf_as_buffer = {
|
||||
/* Methods */
|
||||
|
||||
static TyObject *
|
||||
picklebuf_raw(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
picklebuf_raw(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyPickleBufferObject *self = (PyPickleBufferObject*)op;
|
||||
if (self->view.obj == NULL) {
|
||||
@@ -190,11 +190,11 @@ Return a memoryview of the raw memory underlying this buffer.\n\
|
||||
Will raise BufferError is the buffer isn't contiguous.");
|
||||
|
||||
static TyObject *
|
||||
picklebuf_release(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
picklebuf_release(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyPickleBufferObject *self = (PyPickleBufferObject*)op;
|
||||
PyBuffer_Release(&self->view);
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(picklebuf_release_doc,
|
||||
|
||||
@@ -255,7 +255,7 @@ compute_range_length(TyObject *start, TyObject *stop, TyObject *step)
|
||||
}
|
||||
assert(len == -2);
|
||||
|
||||
cmp_result = PyObject_RichCompareBool(step, zero, Ty_GT);
|
||||
cmp_result = PyObject_RichCompareBool(step, zero, Py_GT);
|
||||
if (cmp_result == -1)
|
||||
return NULL;
|
||||
|
||||
@@ -272,7 +272,7 @@ compute_range_length(TyObject *start, TyObject *stop, TyObject *step)
|
||||
}
|
||||
|
||||
/* if (lo >= hi), return length of 0. */
|
||||
cmp_result = PyObject_RichCompareBool(lo, hi, Ty_GE);
|
||||
cmp_result = PyObject_RichCompareBool(lo, hi, Py_GE);
|
||||
if (cmp_result != 0) {
|
||||
Ty_DECREF(step);
|
||||
if (cmp_result < 0)
|
||||
@@ -349,7 +349,7 @@ compute_range_item(rangeobject *r, TyObject *arg)
|
||||
* i = arg
|
||||
* }
|
||||
*/
|
||||
cmp_result = PyObject_RichCompareBool(arg, zero, Ty_LT);
|
||||
cmp_result = PyObject_RichCompareBool(arg, zero, Py_LT);
|
||||
if (cmp_result == -1) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -367,9 +367,9 @@ compute_range_item(rangeobject *r, TyObject *arg)
|
||||
* <report index out of bounds>
|
||||
* }
|
||||
*/
|
||||
cmp_result = PyObject_RichCompareBool(i, zero, Ty_LT);
|
||||
cmp_result = PyObject_RichCompareBool(i, zero, Py_LT);
|
||||
if (cmp_result == 0) {
|
||||
cmp_result = PyObject_RichCompareBool(i, r->length, Ty_GE);
|
||||
cmp_result = PyObject_RichCompareBool(i, r->length, Py_GE);
|
||||
}
|
||||
if (cmp_result == -1) {
|
||||
Ty_DECREF(i);
|
||||
@@ -451,16 +451,16 @@ range_contains_long(rangeobject *r, TyObject *ob)
|
||||
|
||||
/* Check if the value can possibly be in the range. */
|
||||
|
||||
cmp1 = PyObject_RichCompareBool(r->step, zero, Ty_GT);
|
||||
cmp1 = PyObject_RichCompareBool(r->step, zero, Py_GT);
|
||||
if (cmp1 == -1)
|
||||
goto end;
|
||||
if (cmp1 == 1) { /* positive steps: start <= ob < stop */
|
||||
cmp2 = PyObject_RichCompareBool(r->start, ob, Ty_LE);
|
||||
cmp3 = PyObject_RichCompareBool(ob, r->stop, Ty_LT);
|
||||
cmp2 = PyObject_RichCompareBool(r->start, ob, Py_LE);
|
||||
cmp3 = PyObject_RichCompareBool(ob, r->stop, Py_LT);
|
||||
}
|
||||
else { /* negative steps: stop < ob <= start */
|
||||
cmp2 = PyObject_RichCompareBool(ob, r->start, Ty_LE);
|
||||
cmp3 = PyObject_RichCompareBool(r->stop, ob, Ty_LT);
|
||||
cmp2 = PyObject_RichCompareBool(ob, r->start, Py_LE);
|
||||
cmp3 = PyObject_RichCompareBool(r->stop, ob, Py_LT);
|
||||
}
|
||||
|
||||
if (cmp2 == -1 || cmp3 == -1) /* TypeError */
|
||||
@@ -478,7 +478,7 @@ range_contains_long(rangeobject *r, TyObject *ob)
|
||||
if (tmp2 == NULL)
|
||||
goto end;
|
||||
/* result = ((int(ob) - start) % step) == 0 */
|
||||
result = PyObject_RichCompareBool(tmp2, zero, Ty_EQ);
|
||||
result = PyObject_RichCompareBool(tmp2, zero, Py_EQ);
|
||||
end:
|
||||
Ty_XDECREF(tmp1);
|
||||
Ty_XDECREF(tmp2);
|
||||
@@ -518,7 +518,7 @@ range_equals(rangeobject *r0, rangeobject *r1)
|
||||
|
||||
if (r0 == r1)
|
||||
return 1;
|
||||
cmp_result = PyObject_RichCompareBool(r0->length, r1->length, Ty_EQ);
|
||||
cmp_result = PyObject_RichCompareBool(r0->length, r1->length, Py_EQ);
|
||||
/* Return False or error to the caller. */
|
||||
if (cmp_result != 1)
|
||||
return cmp_result;
|
||||
@@ -526,15 +526,15 @@ range_equals(rangeobject *r0, rangeobject *r1)
|
||||
/* Return True or error to the caller. */
|
||||
if (cmp_result != 0)
|
||||
return cmp_result;
|
||||
cmp_result = PyObject_RichCompareBool(r0->start, r1->start, Ty_EQ);
|
||||
cmp_result = PyObject_RichCompareBool(r0->start, r1->start, Py_EQ);
|
||||
/* Return False or error to the caller. */
|
||||
if (cmp_result != 1)
|
||||
return cmp_result;
|
||||
cmp_result = PyObject_RichCompareBool(r0->length, _TyLong_GetOne(), Ty_EQ);
|
||||
cmp_result = PyObject_RichCompareBool(r0->length, _TyLong_GetOne(), Py_EQ);
|
||||
/* Return True or error to the caller. */
|
||||
if (cmp_result != 0)
|
||||
return cmp_result;
|
||||
return PyObject_RichCompareBool(r0->step, r1->step, Ty_EQ);
|
||||
return PyObject_RichCompareBool(r0->step, r1->step, Py_EQ);
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -543,24 +543,24 @@ range_richcompare(TyObject *self, TyObject *other, int op)
|
||||
int result;
|
||||
|
||||
if (!TyRange_Check(other))
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
switch (op) {
|
||||
case Ty_NE:
|
||||
case Ty_EQ:
|
||||
case Py_NE:
|
||||
case Py_EQ:
|
||||
result = range_equals((rangeobject*)self, (rangeobject*)other);
|
||||
if (result == -1)
|
||||
return NULL;
|
||||
if (op == Ty_NE)
|
||||
if (op == Py_NE)
|
||||
result = !result;
|
||||
if (result)
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
else
|
||||
Ty_RETURN_FALSE;
|
||||
case Ty_LE:
|
||||
case Ty_GE:
|
||||
case Ty_LT:
|
||||
case Ty_GT:
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_FALSE;
|
||||
case Py_LE:
|
||||
case Py_GE:
|
||||
case Py_LT:
|
||||
case Py_GT:
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
default:
|
||||
TyErr_BadArgument();
|
||||
return NULL;
|
||||
@@ -596,7 +596,7 @@ range_hash(TyObject *op)
|
||||
}
|
||||
else {
|
||||
TyTuple_SET_ITEM(t, 1, Ty_NewRef(r->start));
|
||||
cmp_result = PyObject_RichCompareBool(r->length, _TyLong_GetOne(), Ty_EQ);
|
||||
cmp_result = PyObject_RichCompareBool(r->length, _TyLong_GetOne(), Py_EQ);
|
||||
if (cmp_result == -1)
|
||||
goto end;
|
||||
if (cmp_result == 1) {
|
||||
@@ -751,7 +751,7 @@ static PyNumberMethods range_as_number = {
|
||||
};
|
||||
|
||||
static TyObject * range_iter(TyObject *seq);
|
||||
static TyObject * range_reverse(TyObject *seq, TyObject *Ty_UNUSED(ignored));
|
||||
static TyObject * range_reverse(TyObject *seq, TyObject *Py_UNUSED(ignored));
|
||||
|
||||
PyDoc_STRVAR(reverse_doc,
|
||||
"Return a reverse iterator.");
|
||||
@@ -772,9 +772,9 @@ static TyMethodDef range_methods[] = {
|
||||
};
|
||||
|
||||
static TyMemberDef range_members[] = {
|
||||
{"start", Ty_T_OBJECT_EX, offsetof(rangeobject, start), Ty_READONLY},
|
||||
{"stop", Ty_T_OBJECT_EX, offsetof(rangeobject, stop), Ty_READONLY},
|
||||
{"step", Ty_T_OBJECT_EX, offsetof(rangeobject, step), Ty_READONLY},
|
||||
{"start", Ty_T_OBJECT_EX, offsetof(rangeobject, start), Py_READONLY},
|
||||
{"stop", Ty_T_OBJECT_EX, offsetof(rangeobject, stop), Py_READONLY},
|
||||
{"step", Ty_T_OBJECT_EX, offsetof(rangeobject, step), Py_READONLY},
|
||||
{0}
|
||||
};
|
||||
|
||||
@@ -841,7 +841,7 @@ rangeiter_next(TyObject *op)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
rangeiter_len(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
rangeiter_len(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
_PyRangeIterObject *r = (_PyRangeIterObject*)op;
|
||||
return TyLong_FromLong(r->len);
|
||||
@@ -851,7 +851,7 @@ PyDoc_STRVAR(length_hint_doc,
|
||||
"Private method returning an estimate of len(list(it)).");
|
||||
|
||||
static TyObject *
|
||||
rangeiter_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
rangeiter_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
_PyRangeIterObject *r = (_PyRangeIterObject*)op;
|
||||
TyObject *start=NULL, *stop=NULL, *step=NULL;
|
||||
@@ -895,7 +895,7 @@ rangeiter_setstate(TyObject *op, TyObject *state)
|
||||
index = r->len; /* exhausted iterator */
|
||||
r->start += index * r->step;
|
||||
r->len -= index;
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1003,7 +1003,7 @@ typedef struct {
|
||||
} longrangeiterobject;
|
||||
|
||||
static TyObject *
|
||||
longrangeiter_len(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
longrangeiter_len(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
longrangeiterobject *r = (longrangeiterobject*)op;
|
||||
Ty_INCREF(r->len);
|
||||
@@ -1011,7 +1011,7 @@ longrangeiter_len(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
longrangeiter_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
longrangeiter_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
longrangeiterobject *r = (longrangeiterobject*)op;
|
||||
TyObject *product, *stop=NULL;
|
||||
@@ -1047,14 +1047,14 @@ longrangeiter_setstate(TyObject *op, TyObject *state)
|
||||
int cmp;
|
||||
|
||||
/* clip the value */
|
||||
cmp = PyObject_RichCompareBool(state, zero, Ty_LT);
|
||||
cmp = PyObject_RichCompareBool(state, zero, Py_LT);
|
||||
if (cmp < 0)
|
||||
return NULL;
|
||||
if (cmp > 0) {
|
||||
state = zero;
|
||||
}
|
||||
else {
|
||||
cmp = PyObject_RichCompareBool(r->len, state, Ty_LT);
|
||||
cmp = PyObject_RichCompareBool(r->len, state, Py_LT);
|
||||
if (cmp < 0)
|
||||
return NULL;
|
||||
if (cmp > 0)
|
||||
@@ -1076,7 +1076,7 @@ longrangeiter_setstate(TyObject *op, TyObject *state)
|
||||
r->start = new_start;
|
||||
Ty_SETREF(r->len, new_len);
|
||||
Ty_DECREF(tmp);
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyMethodDef longrangeiter_methods[] = {
|
||||
@@ -1100,7 +1100,7 @@ static TyObject *
|
||||
longrangeiter_next(TyObject *op)
|
||||
{
|
||||
longrangeiterobject *r = (longrangeiterobject*)op;
|
||||
if (PyObject_RichCompareBool(r->len, _TyLong_GetZero(), Ty_GT) != 1)
|
||||
if (PyObject_RichCompareBool(r->len, _TyLong_GetZero(), Py_GT) != 1)
|
||||
return NULL;
|
||||
|
||||
TyObject *new_start = PyNumber_Add(r->start, r->step);
|
||||
@@ -1207,7 +1207,7 @@ range_iter(TyObject *seq)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
range_reverse(TyObject *seq, TyObject *Ty_UNUSED(ignored))
|
||||
range_reverse(TyObject *seq, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
rangeobject *range = (rangeobject*) seq;
|
||||
longrangeiterobject *it;
|
||||
|
||||
@@ -103,7 +103,7 @@ set_lookkey(PySetObject *so, TyObject *key, Ty_hash_t hash)
|
||||
return entry;
|
||||
table = so->table;
|
||||
Ty_INCREF(startkey);
|
||||
cmp = PyObject_RichCompareBool(startkey, key, Ty_EQ);
|
||||
cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
|
||||
Ty_DECREF(startkey);
|
||||
if (cmp < 0)
|
||||
return NULL;
|
||||
@@ -158,7 +158,7 @@ set_add_entry_takeref(PySetObject *so, TyObject *key, Ty_hash_t hash)
|
||||
goto found_active;
|
||||
table = so->table;
|
||||
Ty_INCREF(startkey);
|
||||
cmp = PyObject_RichCompareBool(startkey, key, Ty_EQ);
|
||||
cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
|
||||
Ty_DECREF(startkey);
|
||||
if (cmp > 0)
|
||||
goto found_active;
|
||||
@@ -849,7 +849,7 @@ setiter_traverse(TyObject *self, visitproc visit, void *arg)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
setiter_len(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
setiter_len(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
setiterobject *si = (setiterobject*)op;
|
||||
Ty_ssize_t len = 0;
|
||||
@@ -861,7 +861,7 @@ setiter_len(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).");
|
||||
|
||||
static TyObject *
|
||||
setiter_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
setiter_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
setiterobject *si = (setiterobject*)op;
|
||||
|
||||
@@ -1116,7 +1116,7 @@ set_update_impl(PySetObject *so, TyObject * const *others,
|
||||
if (set_update_internal(so, other))
|
||||
return NULL;
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* XXX Todo:
|
||||
@@ -1325,7 +1325,7 @@ set_clear_impl(PySetObject *so)
|
||||
/*[clinic end generated code: output=4e71d5a83904161a input=c6f831b366111950]*/
|
||||
{
|
||||
set_clear_internal((TyObject*)so);
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -1367,7 +1367,7 @@ set_or(TyObject *self, TyObject *other)
|
||||
PySetObject *result;
|
||||
|
||||
if (!PyAnySet_Check(self) || !PyAnySet_Check(other))
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
|
||||
result = (PySetObject *)set_copy(self, NULL);
|
||||
if (result == NULL) {
|
||||
@@ -1387,7 +1387,7 @@ static TyObject *
|
||||
set_ior(TyObject *self, TyObject *other)
|
||||
{
|
||||
if (!PyAnySet_Check(other))
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
PySetObject *so = _TySet_CAST(self);
|
||||
|
||||
if (set_update_internal(so, other)) {
|
||||
@@ -1524,7 +1524,7 @@ set_intersection_update(PySetObject *so, TyObject *other)
|
||||
return NULL;
|
||||
set_swap_bodies(so, (PySetObject *)tmp);
|
||||
Ty_DECREF(tmp);
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -1549,14 +1549,14 @@ set_intersection_update_multi_impl(PySetObject *so, TyObject * const *others,
|
||||
set_swap_bodies(so, (PySetObject *)tmp);
|
||||
Ty_END_CRITICAL_SECTION();
|
||||
Ty_DECREF(tmp);
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
set_and(TyObject *self, TyObject *other)
|
||||
{
|
||||
if (!PyAnySet_Check(self) || !PyAnySet_Check(other))
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
PySetObject *so = _TySet_CAST(self);
|
||||
|
||||
TyObject *rv;
|
||||
@@ -1573,7 +1573,7 @@ set_iand(TyObject *self, TyObject *other)
|
||||
TyObject *result;
|
||||
|
||||
if (!PyAnySet_Check(other))
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
PySetObject *so = _TySet_CAST(self);
|
||||
|
||||
Ty_BEGIN_CRITICAL_SECTION2(so, other);
|
||||
@@ -1605,9 +1605,9 @@ set_isdisjoint_impl(PySetObject *so, TyObject *other)
|
||||
|
||||
if ((TyObject *)so == other) {
|
||||
if (TySet_GET_SIZE(so) == 0)
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
else
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (PyAnySet_CheckExact(other)) {
|
||||
@@ -1628,10 +1628,10 @@ set_isdisjoint_impl(PySetObject *so, TyObject *other)
|
||||
return NULL;
|
||||
}
|
||||
if (rv) {
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
it = PyObject_GetIter(other);
|
||||
@@ -1647,13 +1647,13 @@ set_isdisjoint_impl(PySetObject *so, TyObject *other)
|
||||
}
|
||||
if (rv) {
|
||||
Ty_DECREF(it);
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
Ty_DECREF(it);
|
||||
if (TyErr_Occurred())
|
||||
return NULL;
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1742,7 +1742,7 @@ set_difference_update_impl(PySetObject *so, TyObject * const *others,
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -1880,7 +1880,7 @@ static TyObject *
|
||||
set_sub(TyObject *self, TyObject *other)
|
||||
{
|
||||
if (!PyAnySet_Check(self) || !PyAnySet_Check(other))
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
PySetObject *so = _TySet_CAST(self);
|
||||
|
||||
TyObject *rv;
|
||||
@@ -1894,7 +1894,7 @@ static TyObject *
|
||||
set_isub(TyObject *self, TyObject *other)
|
||||
{
|
||||
if (!PyAnySet_Check(other))
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
PySetObject *so = _TySet_CAST(self);
|
||||
|
||||
int rv;
|
||||
@@ -2004,7 +2004,7 @@ set_symmetric_difference_update_impl(PySetObject *so, TyObject *other)
|
||||
if (rv < 0) {
|
||||
return NULL;
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -2040,7 +2040,7 @@ static TyObject *
|
||||
set_xor(TyObject *self, TyObject *other)
|
||||
{
|
||||
if (!PyAnySet_Check(self) || !PyAnySet_Check(other))
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
PySetObject *so = _TySet_CAST(self);
|
||||
return set_symmetric_difference((TyObject*)so, other);
|
||||
}
|
||||
@@ -2051,7 +2051,7 @@ set_ixor(TyObject *self, TyObject *other)
|
||||
TyObject *result;
|
||||
|
||||
if (!PyAnySet_Check(other))
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
PySetObject *so = _TySet_CAST(self);
|
||||
|
||||
result = set_symmetric_difference_update((TyObject*)so, other);
|
||||
@@ -2089,7 +2089,7 @@ set_issubset_impl(PySetObject *so, TyObject *other)
|
||||
return TyBool_FromLong(result);
|
||||
}
|
||||
if (TySet_GET_SIZE(so) > TySet_GET_SIZE(other))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
while (set_next(so, &pos, &entry)) {
|
||||
TyObject *key = entry->key;
|
||||
@@ -2100,10 +2100,10 @@ set_issubset_impl(PySetObject *so, TyObject *other)
|
||||
return NULL;
|
||||
}
|
||||
if (!rv) {
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -2137,14 +2137,14 @@ set_issuperset_impl(PySetObject *so, TyObject *other)
|
||||
}
|
||||
if (!rv) {
|
||||
Ty_DECREF(it);
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
Ty_DECREF(it);
|
||||
if (TyErr_Occurred()) {
|
||||
return NULL;
|
||||
}
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -2155,19 +2155,19 @@ set_richcompare(TyObject *self, TyObject *w, int op)
|
||||
int r2;
|
||||
|
||||
if(!PyAnySet_Check(w))
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
|
||||
switch (op) {
|
||||
case Ty_EQ:
|
||||
case Py_EQ:
|
||||
if (TySet_GET_SIZE(v) != TySet_GET_SIZE(w))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
Ty_hash_t v_hash = FT_ATOMIC_LOAD_SSIZE_RELAXED(v->hash);
|
||||
Ty_hash_t w_hash = FT_ATOMIC_LOAD_SSIZE_RELAXED(((PySetObject *)w)->hash);
|
||||
if (v_hash != -1 && w_hash != -1 && v_hash != w_hash)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
return set_issubset((TyObject*)v, w);
|
||||
case Ty_NE:
|
||||
r1 = set_richcompare((TyObject*)v, w, Ty_EQ);
|
||||
case Py_NE:
|
||||
r1 = set_richcompare((TyObject*)v, w, Py_EQ);
|
||||
if (r1 == NULL)
|
||||
return NULL;
|
||||
r2 = PyObject_IsTrue(r1);
|
||||
@@ -2175,20 +2175,20 @@ set_richcompare(TyObject *self, TyObject *w, int op)
|
||||
if (r2 < 0)
|
||||
return NULL;
|
||||
return TyBool_FromLong(!r2);
|
||||
case Ty_LE:
|
||||
case Py_LE:
|
||||
return set_issubset((TyObject*)v, w);
|
||||
case Ty_GE:
|
||||
case Py_GE:
|
||||
return set_issuperset((TyObject*)v, w);
|
||||
case Ty_LT:
|
||||
case Py_LT:
|
||||
if (TySet_GET_SIZE(v) >= TySet_GET_SIZE(w))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
return set_issubset((TyObject*)v, w);
|
||||
case Ty_GT:
|
||||
case Py_GT:
|
||||
if (TySet_GET_SIZE(v) <= TySet_GET_SIZE(w))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
return set_issuperset((TyObject*)v, w);
|
||||
}
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -2209,7 +2209,7 @@ set_add_impl(PySetObject *so, TyObject *key)
|
||||
{
|
||||
if (set_add_key(so, key))
|
||||
return NULL;
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -2329,7 +2329,7 @@ set_remove_impl(PySetObject *so, TyObject *key)
|
||||
_TyErr_SetKeyError(key);
|
||||
return NULL;
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -2364,7 +2364,7 @@ set_discard_impl(PySetObject *so, TyObject *key)
|
||||
if (rv < 0)
|
||||
return NULL;
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
|
||||
@@ -21,7 +21,7 @@ this type and there is exactly one in existence.
|
||||
#include "pycore_object.h" // _TyObject_GC_TRACK()
|
||||
|
||||
|
||||
#define _PySlice_CAST(op) _Ty_CAST(PySliceObject*, (op))
|
||||
#define _PySlice_CAST(op) _Py_CAST(PySliceObject*, (op))
|
||||
|
||||
|
||||
static TyObject *
|
||||
@@ -51,7 +51,7 @@ ellipsis_repr(TyObject *op)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
ellipsis_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
ellipsis_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return TyUnicode_FromString("Ellipsis");
|
||||
}
|
||||
@@ -363,9 +363,9 @@ slice_repr(TyObject *op)
|
||||
}
|
||||
|
||||
static TyMemberDef slice_members[] = {
|
||||
{"start", _Ty_T_OBJECT, offsetof(PySliceObject, start), Ty_READONLY},
|
||||
{"stop", _Ty_T_OBJECT, offsetof(PySliceObject, stop), Ty_READONLY},
|
||||
{"step", _Ty_T_OBJECT, offsetof(PySliceObject, step), Ty_READONLY},
|
||||
{"start", _Ty_T_OBJECT, offsetof(PySliceObject, start), Py_READONLY},
|
||||
{"stop", _Ty_T_OBJECT, offsetof(PySliceObject, stop), Py_READONLY},
|
||||
{"step", _Ty_T_OBJECT, offsetof(PySliceObject, step), Py_READONLY},
|
||||
{0}
|
||||
};
|
||||
|
||||
@@ -452,7 +452,7 @@ _PySlice_GetLongIndices(PySliceObject *self, TyObject *length,
|
||||
if (start == NULL)
|
||||
goto error;
|
||||
|
||||
cmp_result = PyObject_RichCompareBool(start, lower, Ty_LT);
|
||||
cmp_result = PyObject_RichCompareBool(start, lower, Py_LT);
|
||||
if (cmp_result < 0)
|
||||
goto error;
|
||||
if (cmp_result) {
|
||||
@@ -460,7 +460,7 @@ _PySlice_GetLongIndices(PySliceObject *self, TyObject *length,
|
||||
}
|
||||
}
|
||||
else {
|
||||
cmp_result = PyObject_RichCompareBool(start, upper, Ty_GT);
|
||||
cmp_result = PyObject_RichCompareBool(start, upper, Py_GT);
|
||||
if (cmp_result < 0)
|
||||
goto error;
|
||||
if (cmp_result) {
|
||||
@@ -485,7 +485,7 @@ _PySlice_GetLongIndices(PySliceObject *self, TyObject *length,
|
||||
if (stop == NULL)
|
||||
goto error;
|
||||
|
||||
cmp_result = PyObject_RichCompareBool(stop, lower, Ty_LT);
|
||||
cmp_result = PyObject_RichCompareBool(stop, lower, Py_LT);
|
||||
if (cmp_result < 0)
|
||||
goto error;
|
||||
if (cmp_result) {
|
||||
@@ -493,7 +493,7 @@ _PySlice_GetLongIndices(PySliceObject *self, TyObject *length,
|
||||
}
|
||||
}
|
||||
else {
|
||||
cmp_result = PyObject_RichCompareBool(stop, upper, Ty_GT);
|
||||
cmp_result = PyObject_RichCompareBool(stop, upper, Py_GT);
|
||||
if (cmp_result < 0)
|
||||
goto error;
|
||||
if (cmp_result) {
|
||||
@@ -558,7 +558,7 @@ S. Out of bounds indices are clipped in a manner consistent with the\n\
|
||||
handling of normal slices.");
|
||||
|
||||
static TyObject *
|
||||
slice_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
slice_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PySliceObject *self = _PySlice_CAST(op);
|
||||
return Ty_BuildValue("O(OOO)", Ty_TYPE(self), self->start, self->stop, self->step);
|
||||
@@ -576,16 +576,16 @@ static TyObject *
|
||||
slice_richcompare(TyObject *v, TyObject *w, int op)
|
||||
{
|
||||
if (!TySlice_Check(v) || !TySlice_Check(w))
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
|
||||
if (v == w) {
|
||||
TyObject *res;
|
||||
/* XXX Do we really need this shortcut?
|
||||
There's a unit test for it, but is that fair? */
|
||||
switch (op) {
|
||||
case Ty_EQ:
|
||||
case Ty_LE:
|
||||
case Ty_GE:
|
||||
case Py_EQ:
|
||||
case Py_LE:
|
||||
case Py_GE:
|
||||
res = Ty_True;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -5,49 +5,49 @@
|
||||
#include "pycore_bytes_methods.h"
|
||||
|
||||
static TyObject*
|
||||
stringlib_isspace(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
stringlib_isspace(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _Ty_bytes_isspace(STRINGLIB_STR(self), STRINGLIB_LEN(self));
|
||||
}
|
||||
|
||||
static TyObject*
|
||||
stringlib_isalpha(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
stringlib_isalpha(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _Ty_bytes_isalpha(STRINGLIB_STR(self), STRINGLIB_LEN(self));
|
||||
}
|
||||
|
||||
static TyObject*
|
||||
stringlib_isalnum(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
stringlib_isalnum(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _Ty_bytes_isalnum(STRINGLIB_STR(self), STRINGLIB_LEN(self));
|
||||
}
|
||||
|
||||
static TyObject*
|
||||
stringlib_isascii(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
stringlib_isascii(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _Ty_bytes_isascii(STRINGLIB_STR(self), STRINGLIB_LEN(self));
|
||||
}
|
||||
|
||||
static TyObject*
|
||||
stringlib_isdigit(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
stringlib_isdigit(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _Ty_bytes_isdigit(STRINGLIB_STR(self), STRINGLIB_LEN(self));
|
||||
}
|
||||
|
||||
static TyObject*
|
||||
stringlib_islower(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
stringlib_islower(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _Ty_bytes_islower(STRINGLIB_STR(self), STRINGLIB_LEN(self));
|
||||
}
|
||||
|
||||
static TyObject*
|
||||
stringlib_isupper(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
stringlib_isupper(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _Ty_bytes_isupper(STRINGLIB_STR(self), STRINGLIB_LEN(self));
|
||||
}
|
||||
|
||||
static TyObject*
|
||||
stringlib_istitle(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
stringlib_istitle(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _Ty_bytes_istitle(STRINGLIB_STR(self), STRINGLIB_LEN(self));
|
||||
}
|
||||
@@ -56,7 +56,7 @@ stringlib_istitle(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
/* functions that return a new object partially translated by ctype funcs: */
|
||||
|
||||
static TyObject*
|
||||
stringlib_lower(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
stringlib_lower(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject* newobj;
|
||||
newobj = STRINGLIB_NEW(NULL, STRINGLIB_LEN(self));
|
||||
@@ -68,7 +68,7 @@ stringlib_lower(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject*
|
||||
stringlib_upper(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
stringlib_upper(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject* newobj;
|
||||
newobj = STRINGLIB_NEW(NULL, STRINGLIB_LEN(self));
|
||||
@@ -80,7 +80,7 @@ stringlib_upper(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject*
|
||||
stringlib_title(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
stringlib_title(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject* newobj;
|
||||
newobj = STRINGLIB_NEW(NULL, STRINGLIB_LEN(self));
|
||||
@@ -92,7 +92,7 @@ stringlib_title(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject*
|
||||
stringlib_capitalize(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
stringlib_capitalize(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject* newobj;
|
||||
newobj = STRINGLIB_NEW(NULL, STRINGLIB_LEN(self));
|
||||
@@ -104,7 +104,7 @@ stringlib_capitalize(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
}
|
||||
|
||||
static TyObject*
|
||||
stringlib_swapcase(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
stringlib_swapcase(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject* newobj;
|
||||
newobj = STRINGLIB_NEW(NULL, STRINGLIB_LEN(self));
|
||||
|
||||
@@ -64,7 +64,7 @@ Ty_LOCAL_INLINE(TyObject *)
|
||||
SubString_new_object(SubString *str)
|
||||
{
|
||||
if (str->str == NULL)
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
return TyUnicode_Substring(str->str, str->start, str->end);
|
||||
}
|
||||
|
||||
@@ -1100,7 +1100,7 @@ static TyTypeObject PyFormatterIter_Type = {
|
||||
describing the parsed elements. It's a wrapper around
|
||||
stringlib/string_format.h's MarkupIterator */
|
||||
static TyObject *
|
||||
formatter_parser(TyObject *Ty_UNUSED(module), TyObject *self)
|
||||
formatter_parser(TyObject *Py_UNUSED(module), TyObject *self)
|
||||
{
|
||||
formatteriterobject *it;
|
||||
|
||||
@@ -1236,7 +1236,7 @@ static TyTypeObject PyFieldNameIter_Type = {
|
||||
field_name_split. The iterator it returns is a
|
||||
FieldNameIterator */
|
||||
static TyObject *
|
||||
formatter_field_name_split(TyObject *Ty_UNUSED(module), TyObject *self)
|
||||
formatter_field_name_split(TyObject *Py_UNUSED(module), TyObject *self)
|
||||
{
|
||||
SubString first;
|
||||
Ty_ssize_t first_idx;
|
||||
|
||||
@@ -336,7 +336,7 @@ error:
|
||||
|
||||
|
||||
static TyObject *
|
||||
structseq_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
structseq_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
PyStructSequence *self = (PyStructSequence*)op;
|
||||
TyObject* tup = NULL;
|
||||
@@ -554,7 +554,7 @@ initialize_members(PyStructSequence_Desc *desc,
|
||||
members[k].type = _Ty_T_OBJECT;
|
||||
members[k].offset = offsetof(PyStructSequence, ob_item)
|
||||
+ i * sizeof(TyObject*);
|
||||
members[k].flags = Ty_READONLY;
|
||||
members[k].flags = Py_READONLY;
|
||||
members[k].doc = desc->fields[i].doc;
|
||||
k++;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ typedef struct {
|
||||
} templateiterobject;
|
||||
|
||||
#define templateiterobject_CAST(op) \
|
||||
(assert(_PyTemplateIter_CheckExact(op)), _Ty_CAST(templateiterobject*, (op)))
|
||||
(assert(_PyTemplateIter_CheckExact(op)), _Py_CAST(templateiterobject*, (op)))
|
||||
|
||||
static TyObject *
|
||||
templateiter_next(TyObject *op)
|
||||
@@ -87,7 +87,7 @@ typedef struct {
|
||||
} templateobject;
|
||||
|
||||
#define templateobject_CAST(op) \
|
||||
(assert(_PyTemplate_CheckExact(op)), _Ty_CAST(templateobject*, (op)))
|
||||
(assert(_PyTemplate_CheckExact(op)), _Py_CAST(templateobject*, (op)))
|
||||
|
||||
static TyObject *
|
||||
template_new(TyTypeObject *type, TyObject *args, TyObject *kwds)
|
||||
@@ -311,7 +311,7 @@ _PyTemplate_Concat(TyObject *self, TyObject *other)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
template_values_get(TyObject *op, void *Ty_UNUSED(data))
|
||||
template_values_get(TyObject *op, void *Py_UNUSED(data))
|
||||
{
|
||||
templateobject *self = templateobject_CAST(op);
|
||||
|
||||
@@ -330,8 +330,8 @@ template_values_get(TyObject *op, void *Ty_UNUSED(data))
|
||||
}
|
||||
|
||||
static TyMemberDef template_members[] = {
|
||||
{"strings", Ty_T_OBJECT_EX, offsetof(templateobject, strings), Ty_READONLY, "Strings"},
|
||||
{"interpolations", Ty_T_OBJECT_EX, offsetof(templateobject, interpolations), Ty_READONLY, "Interpolations"},
|
||||
{"strings", Ty_T_OBJECT_EX, offsetof(templateobject, strings), Py_READONLY, "Strings"},
|
||||
{"interpolations", Ty_T_OBJECT_EX, offsetof(templateobject, interpolations), Py_READONLY, "Interpolations"},
|
||||
{NULL},
|
||||
};
|
||||
|
||||
@@ -346,7 +346,7 @@ static PySequenceMethods template_as_sequence = {
|
||||
};
|
||||
|
||||
static TyObject*
|
||||
template_reduce(TyObject *op, TyObject *Ty_UNUSED(dummy))
|
||||
template_reduce(TyObject *op, TyObject *Py_UNUSED(dummy))
|
||||
{
|
||||
TyObject *mod = TyImport_ImportModule("string.templatelib");
|
||||
if (mod == NULL) {
|
||||
|
||||
@@ -349,7 +349,7 @@ tuple_contains(TyObject *self, TyObject *el)
|
||||
PyTupleObject *a = _TyTuple_CAST(self);
|
||||
int cmp = 0;
|
||||
for (Ty_ssize_t i = 0; cmp == 0 && i < Ty_SIZE(a); ++i) {
|
||||
cmp = PyObject_RichCompareBool(TyTuple_GET_ITEM(a, i), el, Ty_EQ);
|
||||
cmp = PyObject_RichCompareBool(TyTuple_GET_ITEM(a, i), el, Py_EQ);
|
||||
}
|
||||
return cmp;
|
||||
}
|
||||
@@ -579,7 +579,7 @@ tuple_index_impl(PyTupleObject *self, TyObject *value, Ty_ssize_t start,
|
||||
stop = Ty_SIZE(self);
|
||||
}
|
||||
for (i = start; i < stop; i++) {
|
||||
int cmp = PyObject_RichCompareBool(self->ob_item[i], value, Ty_EQ);
|
||||
int cmp = PyObject_RichCompareBool(self->ob_item[i], value, Py_EQ);
|
||||
if (cmp > 0)
|
||||
return TyLong_FromSsize_t(i);
|
||||
else if (cmp < 0)
|
||||
@@ -606,7 +606,7 @@ tuple_count_impl(PyTupleObject *self, TyObject *value)
|
||||
Ty_ssize_t i;
|
||||
|
||||
for (i = 0; i < Ty_SIZE(self); i++) {
|
||||
int cmp = PyObject_RichCompareBool(self->ob_item[i], value, Ty_EQ);
|
||||
int cmp = PyObject_RichCompareBool(self->ob_item[i], value, Py_EQ);
|
||||
if (cmp > 0)
|
||||
count++;
|
||||
else if (cmp < 0)
|
||||
@@ -633,7 +633,7 @@ tuple_richcompare(TyObject *v, TyObject *w, int op)
|
||||
Ty_ssize_t vlen, wlen;
|
||||
|
||||
if (!TyTuple_Check(v) || !TyTuple_Check(w))
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
|
||||
vt = (PyTupleObject *)v;
|
||||
wt = (PyTupleObject *)w;
|
||||
@@ -654,7 +654,7 @@ tuple_richcompare(TyObject *v, TyObject *w, int op)
|
||||
*/
|
||||
for (i = 0; i < vlen && i < wlen; i++) {
|
||||
int k = PyObject_RichCompareBool(vt->ob_item[i],
|
||||
wt->ob_item[i], Ty_EQ);
|
||||
wt->ob_item[i], Py_EQ);
|
||||
if (k < 0)
|
||||
return NULL;
|
||||
if (!k)
|
||||
@@ -663,15 +663,15 @@ tuple_richcompare(TyObject *v, TyObject *w, int op)
|
||||
|
||||
if (i >= vlen || i >= wlen) {
|
||||
/* No more items to compare -- compare sizes */
|
||||
Ty_RETURN_RICHCOMPARE(vlen, wlen, op);
|
||||
Py_RETURN_RICHCOMPARE(vlen, wlen, op);
|
||||
}
|
||||
|
||||
/* We have an item that differs -- shortcuts for EQ/NE */
|
||||
if (op == Ty_EQ) {
|
||||
Ty_RETURN_FALSE;
|
||||
if (op == Py_EQ) {
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
if (op == Ty_NE) {
|
||||
Ty_RETURN_TRUE;
|
||||
if (op == Py_NE) {
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
/* Compare the final item again using the proper operator */
|
||||
@@ -1032,7 +1032,7 @@ tupleiter_next(TyObject *self)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
tupleiter_len(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
tupleiter_len(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
_PyTupleIterObject *it = _PyTupleIterObject_CAST(self);
|
||||
Ty_ssize_t len = 0;
|
||||
@@ -1051,7 +1051,7 @@ tupleiter_len(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).");
|
||||
|
||||
static TyObject *
|
||||
tupleiter_reduce(TyObject *self, TyObject *Ty_UNUSED(ignored))
|
||||
tupleiter_reduce(TyObject *self, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *iter = _TyEval_GetBuiltin(&_Ty_ID(iter));
|
||||
|
||||
@@ -1085,7 +1085,7 @@ tupleiter_setstate(TyObject *self, TyObject *state)
|
||||
index = TyTuple_GET_SIZE(it->it_seq); /* exhausted iterator */
|
||||
FT_ATOMIC_STORE_SSIZE_RELAXED(it->it_index, index);
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(reduce_doc, "Return state information for pickling.");
|
||||
|
||||
@@ -808,7 +808,7 @@ _TyType_GetDocFromInternalDoc(const char *name, const char *internal_doc)
|
||||
const char *doc = _TyType_DocWithoutSignature(name, internal_doc);
|
||||
|
||||
if (!doc || *doc == '\0') {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
return TyUnicode_FromString(doc);
|
||||
@@ -850,7 +850,7 @@ _TyType_GetTextSignatureFromInternalDoc(const char *name, const char *internal_d
|
||||
if (start) {
|
||||
return TyUnicode_FromString(start);
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* back "end" up until it points just past the final ')' */
|
||||
@@ -1332,16 +1332,16 @@ int PyUnstable_Type_AssignVersionTag(TyTypeObject *type)
|
||||
|
||||
|
||||
static TyMemberDef type_members[] = {
|
||||
{"__basicsize__", Ty_T_PYSSIZET, offsetof(TyTypeObject,tp_basicsize),Ty_READONLY},
|
||||
{"__itemsize__", Ty_T_PYSSIZET, offsetof(TyTypeObject, tp_itemsize), Ty_READONLY},
|
||||
{"__flags__", Ty_T_ULONG, offsetof(TyTypeObject, tp_flags), Ty_READONLY},
|
||||
{"__basicsize__", Ty_T_PYSSIZET, offsetof(TyTypeObject,tp_basicsize),Py_READONLY},
|
||||
{"__itemsize__", Ty_T_PYSSIZET, offsetof(TyTypeObject, tp_itemsize), Py_READONLY},
|
||||
{"__flags__", Ty_T_ULONG, offsetof(TyTypeObject, tp_flags), Py_READONLY},
|
||||
/* Note that this value is misleading for static builtin types,
|
||||
since the memory at this offset will always be NULL. */
|
||||
{"__weakrefoffset__", Ty_T_PYSSIZET,
|
||||
offsetof(TyTypeObject, tp_weaklistoffset), Ty_READONLY},
|
||||
{"__base__", _Ty_T_OBJECT, offsetof(TyTypeObject, tp_base), Ty_READONLY},
|
||||
offsetof(TyTypeObject, tp_weaklistoffset), Py_READONLY},
|
||||
{"__base__", _Ty_T_OBJECT, offsetof(TyTypeObject, tp_base), Py_READONLY},
|
||||
{"__dictoffset__", Ty_T_PYSSIZET,
|
||||
offsetof(TyTypeObject, tp_dictoffset), Ty_READONLY},
|
||||
offsetof(TyTypeObject, tp_dictoffset), Py_READONLY},
|
||||
{0}
|
||||
};
|
||||
|
||||
@@ -1384,7 +1384,7 @@ _TyType_Name(TyTypeObject *type)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
type_name(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
type_name(TyObject *tp, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
if (type->tp_flags & Ty_TPFLAGS_HEAPTYPE) {
|
||||
@@ -1397,7 +1397,7 @@ type_name(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
type_qualname(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
type_qualname(TyObject *tp, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
if (type->tp_flags & Ty_TPFLAGS_HEAPTYPE) {
|
||||
@@ -1410,7 +1410,7 @@ type_qualname(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static int
|
||||
type_set_name(TyObject *tp, TyObject *value, void *Ty_UNUSED(closure))
|
||||
type_set_name(TyObject *tp, TyObject *value, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
const char *tp_name;
|
||||
@@ -1488,14 +1488,14 @@ type_module(TyTypeObject *type)
|
||||
}
|
||||
|
||||
static inline TyObject *
|
||||
type_get_module(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
type_get_module(TyObject *tp, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
return type_module(type);
|
||||
}
|
||||
|
||||
static int
|
||||
type_set_module(TyObject *tp, TyObject *value, void *Ty_UNUSED(closure))
|
||||
type_set_module(TyObject *tp, TyObject *value, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
if (!check_set_special_type_attr(type, value, "__module__"))
|
||||
@@ -1551,7 +1551,7 @@ TyType_GetFullyQualifiedName(TyTypeObject *type)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
type_abstractmethods(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
type_abstractmethods(TyObject *tp, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
TyObject *res = NULL;
|
||||
@@ -1570,7 +1570,7 @@ type_abstractmethods(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static int
|
||||
type_set_abstractmethods(TyObject *tp, TyObject *value, void *Ty_UNUSED(closure))
|
||||
type_set_abstractmethods(TyObject *tp, TyObject *value, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
/* __abstractmethods__ should only be set once on a type, in
|
||||
@@ -1609,18 +1609,18 @@ type_set_abstractmethods(TyObject *tp, TyObject *value, void *Ty_UNUSED(closure)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
type_get_bases(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
type_get_bases(TyObject *tp, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
TyObject *bases = _TyType_GetBases(type);
|
||||
if (bases == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return bases;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
type_get_mro(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
type_get_mro(TyObject *tp, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
TyObject *mro;
|
||||
@@ -1858,7 +1858,7 @@ type_set_bases_unlocked(TyTypeObject *type, TyObject *new_bases)
|
||||
}
|
||||
|
||||
static int
|
||||
type_set_bases(TyObject *tp, TyObject *new_bases, void *Ty_UNUSED(closure))
|
||||
type_set_bases(TyObject *tp, TyObject *new_bases, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
int res;
|
||||
@@ -1869,18 +1869,18 @@ type_set_bases(TyObject *tp, TyObject *new_bases, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
type_dict(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
type_dict(TyObject *tp, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
TyObject *dict = lookup_tp_dict(type);
|
||||
if (dict == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return PyDictProxy_New(dict);
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
type_get_doc(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
type_get_doc(TyObject *tp, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
TyObject *result;
|
||||
@@ -1901,14 +1901,14 @@ type_get_doc(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
type_get_text_signature(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
type_get_text_signature(TyObject *tp, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
return _TyType_GetTextSignatureFromInternalDoc(type->tp_name, type->tp_doc, 0);
|
||||
}
|
||||
|
||||
static int
|
||||
type_set_doc(TyObject *tp, TyObject *value, void *Ty_UNUSED(closure))
|
||||
type_set_doc(TyObject *tp, TyObject *value, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
if (!check_set_special_type_attr(type, value, "__doc__"))
|
||||
@@ -1919,7 +1919,7 @@ type_set_doc(TyObject *tp, TyObject *value, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
type_get_annotate(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
type_get_annotate(TyObject *tp, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
if (!(type->tp_flags & Ty_TPFLAGS_HEAPTYPE)) {
|
||||
@@ -1959,7 +1959,7 @@ type_get_annotate(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static int
|
||||
type_set_annotate(TyObject *tp, TyObject *value, void *Ty_UNUSED(closure))
|
||||
type_set_annotate(TyObject *tp, TyObject *value, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
if (value == NULL) {
|
||||
@@ -1998,7 +1998,7 @@ type_set_annotate(TyObject *tp, TyObject *value, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
type_get_annotations(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
type_get_annotations(TyObject *tp, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
if (!(type->tp_flags & Ty_TPFLAGS_HEAPTYPE)) {
|
||||
@@ -2068,7 +2068,7 @@ type_get_annotations(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static int
|
||||
type_set_annotations(TyObject *tp, TyObject *value, void *Ty_UNUSED(closure))
|
||||
type_set_annotations(TyObject *tp, TyObject *value, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
if (_TyType_HasFeature(type, Ty_TPFLAGS_IMMUTABLETYPE)) {
|
||||
@@ -2140,7 +2140,7 @@ type_set_annotations(TyObject *tp, TyObject *value, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
type_get_type_params(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
type_get_type_params(TyObject *tp, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
if (type == &TyType_Type) {
|
||||
@@ -2155,7 +2155,7 @@ type_get_type_params(TyObject *tp, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static int
|
||||
type_set_type_params(TyObject *tp, TyObject *value, void *Ty_UNUSED(closure))
|
||||
type_set_type_params(TyObject *tp, TyObject *value, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *type = PyTypeObject_CAST(tp);
|
||||
if (!check_set_special_type_attr(type, value, "__type_params__")) {
|
||||
@@ -2497,7 +2497,7 @@ clear_slots(TyTypeObject *type, TyObject *self)
|
||||
n = Ty_SIZE(type);
|
||||
mp = _PyHeapType_GET_MEMBERS((PyHeapTypeObject *)type);
|
||||
for (i = 0; i < n; i++, mp++) {
|
||||
if (mp->type == Ty_T_OBJECT_EX && !(mp->flags & Ty_READONLY)) {
|
||||
if (mp->type == Ty_T_OBJECT_EX && !(mp->flags & Py_READONLY)) {
|
||||
char *addr = (char *)self + mp->offset;
|
||||
TyObject *obj = *(TyObject **)addr;
|
||||
if (obj != NULL) {
|
||||
@@ -2979,7 +2979,7 @@ vectorcall_maybe(PyThreadState *tstate, TyObject *name,
|
||||
if (func == NULL) {
|
||||
_TyThreadState_PopCStackRef(tstate, &cref);
|
||||
if (!TyErr_Occurred()) {
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -4897,17 +4897,17 @@ special_offset_from_member(
|
||||
memb->name);
|
||||
return -1;
|
||||
}
|
||||
if (memb->flags == Ty_READONLY) {
|
||||
if (memb->flags == Py_READONLY) {
|
||||
*dest = memb->offset;
|
||||
return 0;
|
||||
}
|
||||
else if (memb->flags == (Ty_READONLY | Ty_RELATIVE_OFFSET)) {
|
||||
else if (memb->flags == (Py_READONLY | Ty_RELATIVE_OFFSET)) {
|
||||
*dest = memb->offset + type_data_offset;
|
||||
return 0;
|
||||
}
|
||||
TyErr_Format(
|
||||
TyExc_SystemError,
|
||||
"flags for %s must be Ty_READONLY or (Ty_READONLY | Ty_RELATIVE_OFFSET)",
|
||||
"flags for %s must be Py_READONLY or (Py_READONLY | Ty_RELATIVE_OFFSET)",
|
||||
memb->name);
|
||||
return -1;
|
||||
}
|
||||
@@ -6860,21 +6860,21 @@ object_richcompare(TyObject *self, TyObject *other, int op)
|
||||
|
||||
switch (op) {
|
||||
|
||||
case Ty_EQ:
|
||||
case Py_EQ:
|
||||
/* Return NotImplemented instead of False, so if two
|
||||
objects are compared, both get a chance at the
|
||||
comparison. See issue #1393. */
|
||||
res = Ty_NewRef((self == other) ? Ty_True : Ty_NotImplemented);
|
||||
break;
|
||||
|
||||
case Ty_NE:
|
||||
case Py_NE:
|
||||
/* By default, __ne__() delegates to __eq__() and inverts the result,
|
||||
unless the latter returns NotImplemented. */
|
||||
if (Ty_TYPE(self)->tp_richcompare == NULL) {
|
||||
res = Ty_NewRef(Ty_NotImplemented);
|
||||
break;
|
||||
}
|
||||
res = (*Ty_TYPE(self)->tp_richcompare)(self, other, Ty_EQ);
|
||||
res = (*Ty_TYPE(self)->tp_richcompare)(self, other, Py_EQ);
|
||||
if (res != NULL && res != Ty_NotImplemented) {
|
||||
int ok = PyObject_IsTrue(res);
|
||||
Ty_DECREF(res);
|
||||
@@ -6946,7 +6946,7 @@ same_slots_added(TyTypeObject *a, TyTypeObject *b)
|
||||
slots_a = ((PyHeapTypeObject *)a)->ht_slots;
|
||||
slots_b = ((PyHeapTypeObject *)b)->ht_slots;
|
||||
if (slots_a && slots_b) {
|
||||
if (PyObject_RichCompareBool(slots_a, slots_b, Ty_EQ) != 1)
|
||||
if (PyObject_RichCompareBool(slots_a, slots_b, Py_EQ) != 1)
|
||||
return 0;
|
||||
size += sizeof(TyObject *) * TyTuple_GET_SIZE(slots_a);
|
||||
}
|
||||
@@ -7718,7 +7718,7 @@ object___reduce_ex___impl(TyObject *self, int protocol)
|
||||
static TyObject *
|
||||
object_subclasshook(TyObject *cls, TyObject *args)
|
||||
{
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(object_subclasshook_doc,
|
||||
@@ -7732,7 +7732,7 @@ PyDoc_STRVAR(object_subclasshook_doc,
|
||||
static TyObject *
|
||||
object_init_subclass(TyObject *cls, TyObject *arg)
|
||||
{
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(object_init_subclass_doc,
|
||||
@@ -9329,7 +9329,7 @@ wrap_sq_setitem(TyObject *self, TyObject *args, void *wrapped)
|
||||
res = (*func)(self, i, value);
|
||||
if (res == -1 && TyErr_Occurred())
|
||||
return NULL;
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -9349,7 +9349,7 @@ wrap_sq_delitem(TyObject *self, TyObject *args, void *wrapped)
|
||||
res = (*func)(self, i, NULL);
|
||||
if (res == -1 && TyErr_Occurred())
|
||||
return NULL;
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* XXX objobjproc is a misnomer; should be objargpred */
|
||||
@@ -9382,7 +9382,7 @@ wrap_objobjargproc(TyObject *self, TyObject *args, void *wrapped)
|
||||
res = (*func)(self, key, value);
|
||||
if (res == -1 && TyErr_Occurred())
|
||||
return NULL;
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -9398,7 +9398,7 @@ wrap_delitem(TyObject *self, TyObject *args, void *wrapped)
|
||||
res = (*func)(self, key, NULL);
|
||||
if (res == -1 && TyErr_Occurred())
|
||||
return NULL;
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* Helper to check for object.__setattr__ or __delattr__ applied to a type.
|
||||
@@ -9481,7 +9481,7 @@ wrap_setattr(TyObject *self, TyObject *args, void *wrapped)
|
||||
res = (*func)(self, name, value);
|
||||
if (res < 0)
|
||||
return NULL;
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -9499,7 +9499,7 @@ wrap_delattr(TyObject *self, TyObject *args, void *wrapped)
|
||||
res = (*func)(self, name, NULL);
|
||||
if (res < 0)
|
||||
return NULL;
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -9533,7 +9533,7 @@ wrap_del(TyObject *self, TyObject *args, void *wrapped)
|
||||
return NULL;
|
||||
|
||||
(*func)(self);
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -9556,12 +9556,12 @@ richcmp_##NAME(TyObject *self, TyObject *args, void *wrapped) \
|
||||
return wrap_richcmpfunc(self, args, wrapped, OP); \
|
||||
}
|
||||
|
||||
RICHCMP_WRAPPER(lt, Ty_LT)
|
||||
RICHCMP_WRAPPER(le, Ty_LE)
|
||||
RICHCMP_WRAPPER(eq, Ty_EQ)
|
||||
RICHCMP_WRAPPER(ne, Ty_NE)
|
||||
RICHCMP_WRAPPER(gt, Ty_GT)
|
||||
RICHCMP_WRAPPER(ge, Ty_GE)
|
||||
RICHCMP_WRAPPER(lt, Py_LT)
|
||||
RICHCMP_WRAPPER(le, Py_LE)
|
||||
RICHCMP_WRAPPER(eq, Py_EQ)
|
||||
RICHCMP_WRAPPER(ne, Py_NE)
|
||||
RICHCMP_WRAPPER(gt, Py_GT)
|
||||
RICHCMP_WRAPPER(ge, Py_GE)
|
||||
|
||||
static TyObject *
|
||||
wrap_next(TyObject *self, TyObject *args, void *wrapped)
|
||||
@@ -9610,7 +9610,7 @@ wrap_descr_set(TyObject *self, TyObject *args, void *wrapped)
|
||||
ret = (*func)(self, obj, value);
|
||||
if (ret < 0)
|
||||
return NULL;
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -9626,7 +9626,7 @@ wrap_descr_delete(TyObject *self, TyObject *args, void *wrapped)
|
||||
ret = (*func)(self, obj, NULL);
|
||||
if (ret < 0)
|
||||
return NULL;
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -9666,7 +9666,7 @@ wrap_releasebuffer(TyObject *self, TyObject *args, void *wrapped)
|
||||
PyMemoryViewObject *mview = (PyMemoryViewObject *)arg;
|
||||
if (mview->view.obj == NULL) {
|
||||
// Already released, ignore
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
if (mview->view.obj != self) {
|
||||
TyErr_SetString(TyExc_ValueError,
|
||||
@@ -9683,7 +9683,7 @@ wrap_releasebuffer(TyObject *self, TyObject *args, void *wrapped)
|
||||
return NULL;
|
||||
}
|
||||
Ty_DECREF(res);
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -9693,7 +9693,7 @@ wrap_init(TyObject *self, TyObject *args, void *wrapped, TyObject *kwds)
|
||||
|
||||
if (func(self, args, kwds) < 0)
|
||||
return NULL;
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -9840,7 +9840,7 @@ method_is_overloaded(TyObject *left, TyObject *right, TyObject *name)
|
||||
return 1;
|
||||
}
|
||||
|
||||
ok = PyObject_RichCompareBool(a, b, Ty_NE);
|
||||
ok = PyObject_RichCompareBool(a, b, Py_NE);
|
||||
Ty_DECREF(a);
|
||||
Ty_DECREF(b);
|
||||
return ok;
|
||||
@@ -9887,7 +9887,7 @@ FUNCNAME(TyObject *self, TyObject *other) \
|
||||
stack[1] = self; \
|
||||
return vectorcall_maybe(tstate, &_Ty_ID(RDUNDER), stack, 2); \
|
||||
} \
|
||||
Ty_RETURN_NOTIMPLEMENTED; \
|
||||
Py_RETURN_NOTIMPLEMENTED; \
|
||||
}
|
||||
|
||||
#define SLOT1BIN(FUNCNAME, SLOTNAME, DUNDER, RDUNDER) \
|
||||
@@ -10070,7 +10070,7 @@ slot_nb_power(TyObject *self, TyObject *other, TyObject *modulus)
|
||||
stack[2] = modulus;
|
||||
return vectorcall_maybe(tstate, &_Ty_ID(__rpow__), stack, 3);
|
||||
}
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
SLOT0(slot_nb_negative, __neg__)
|
||||
@@ -10350,7 +10350,7 @@ slot_tp_richcompare(TyObject *self, TyObject *other, int op)
|
||||
if (TyErr_Occurred()) {
|
||||
return NULL;
|
||||
}
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -11673,11 +11673,11 @@ typedef struct {
|
||||
#define superobject_CAST(op) ((superobject *)(op))
|
||||
|
||||
static TyMemberDef super_members[] = {
|
||||
{"__thisclass__", _Ty_T_OBJECT, offsetof(superobject, type), Ty_READONLY,
|
||||
{"__thisclass__", _Ty_T_OBJECT, offsetof(superobject, type), Py_READONLY,
|
||||
"the class invoking super()"},
|
||||
{"__self__", _Ty_T_OBJECT, offsetof(superobject, obj), Ty_READONLY,
|
||||
{"__self__", _Ty_T_OBJECT, offsetof(superobject, obj), Py_READONLY,
|
||||
"the instance invoking super(); may be None"},
|
||||
{"__self_class__", _Ty_T_OBJECT, offsetof(superobject, obj_type), Ty_READONLY,
|
||||
{"__self_class__", _Ty_T_OBJECT, offsetof(superobject, obj_type), Py_READONLY,
|
||||
"the type of the instance invoking super(); may be None"},
|
||||
{0}
|
||||
};
|
||||
|
||||
@@ -75,7 +75,7 @@ NoDefault_repr(TyObject *op)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
NoDefault_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
NoDefault_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return TyUnicode_FromString("NoDefault");
|
||||
}
|
||||
@@ -386,15 +386,15 @@ caller(void)
|
||||
{
|
||||
_PyInterpreterFrame *f = _TyThreadState_GET()->current_frame;
|
||||
if (f == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
if (f == NULL || PyStackRef_IsNull(f->f_funcobj)) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
TyObject *r = TyFunction_GetModule(PyStackRef_AsPyObjectBorrow(f->f_funcobj));
|
||||
if (!r) {
|
||||
TyErr_Clear();
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return Ty_NewRef(r);
|
||||
}
|
||||
@@ -529,22 +529,22 @@ typevar_repr(TyObject *self)
|
||||
}
|
||||
|
||||
static TyMemberDef typevar_members[] = {
|
||||
{"__name__", _Ty_T_OBJECT, offsetof(typevarobject, name), Ty_READONLY},
|
||||
{"__covariant__", Ty_T_BOOL, offsetof(typevarobject, covariant), Ty_READONLY},
|
||||
{"__contravariant__", Ty_T_BOOL, offsetof(typevarobject, contravariant), Ty_READONLY},
|
||||
{"__infer_variance__", Ty_T_BOOL, offsetof(typevarobject, infer_variance), Ty_READONLY},
|
||||
{"__name__", _Ty_T_OBJECT, offsetof(typevarobject, name), Py_READONLY},
|
||||
{"__covariant__", Ty_T_BOOL, offsetof(typevarobject, covariant), Py_READONLY},
|
||||
{"__contravariant__", Ty_T_BOOL, offsetof(typevarobject, contravariant), Py_READONLY},
|
||||
{"__infer_variance__", Ty_T_BOOL, offsetof(typevarobject, infer_variance), Py_READONLY},
|
||||
{0}
|
||||
};
|
||||
|
||||
static TyObject *
|
||||
typevar_bound(TyObject *op, void *Ty_UNUSED(closure))
|
||||
typevar_bound(TyObject *op, void *Py_UNUSED(closure))
|
||||
{
|
||||
typevarobject *self = typevarobject_CAST(op);
|
||||
if (self->bound != NULL) {
|
||||
return Ty_NewRef(self->bound);
|
||||
}
|
||||
if (self->evaluate_bound == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
TyObject *bound = PyObject_CallNoArgs(self->evaluate_bound);
|
||||
self->bound = Ty_XNewRef(bound);
|
||||
@@ -552,7 +552,7 @@ typevar_bound(TyObject *op, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
typevar_default(TyObject *op, void *Ty_UNUSED(closure))
|
||||
typevar_default(TyObject *op, void *Py_UNUSED(closure))
|
||||
{
|
||||
typevarobject *self = typevarobject_CAST(op);
|
||||
if (self->default_value != NULL) {
|
||||
@@ -567,7 +567,7 @@ typevar_default(TyObject *op, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
typevar_constraints(TyObject *op, void *Ty_UNUSED(closure))
|
||||
typevar_constraints(TyObject *op, void *Py_UNUSED(closure))
|
||||
{
|
||||
typevarobject *self = typevarobject_CAST(op);
|
||||
if (self->constraints != NULL) {
|
||||
@@ -582,7 +582,7 @@ typevar_constraints(TyObject *op, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
typevar_evaluate_bound(TyObject *op, void *Ty_UNUSED(closure))
|
||||
typevar_evaluate_bound(TyObject *op, void *Py_UNUSED(closure))
|
||||
{
|
||||
typevarobject *self = typevarobject_CAST(op);
|
||||
if (self->evaluate_bound != NULL) {
|
||||
@@ -591,11 +591,11 @@ typevar_evaluate_bound(TyObject *op, void *Ty_UNUSED(closure))
|
||||
if (self->bound != NULL) {
|
||||
return constevaluator_alloc(self->bound);
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
typevar_evaluate_constraints(TyObject *op, void *Ty_UNUSED(closure))
|
||||
typevar_evaluate_constraints(TyObject *op, void *Py_UNUSED(closure))
|
||||
{
|
||||
typevarobject *self = typevarobject_CAST(op);
|
||||
if (self->evaluate_constraints != NULL) {
|
||||
@@ -604,11 +604,11 @@ typevar_evaluate_constraints(TyObject *op, void *Ty_UNUSED(closure))
|
||||
if (self->constraints != NULL) {
|
||||
return constevaluator_alloc(self->constraints);
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
typevar_evaluate_default(TyObject *op, void *Ty_UNUSED(closure))
|
||||
typevar_evaluate_default(TyObject *op, void *Py_UNUSED(closure))
|
||||
{
|
||||
typevarobject *self = typevarobject_CAST(op);
|
||||
if (self->evaluate_default != NULL) {
|
||||
@@ -617,7 +617,7 @@ typevar_evaluate_default(TyObject *op, void *Ty_UNUSED(closure))
|
||||
if (self->default_value != NULL) {
|
||||
return constevaluator_alloc(self->default_value);
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyGetSetDef typevar_getset[] = {
|
||||
@@ -843,9 +843,9 @@ typevar_has_default_impl(typevarobject *self)
|
||||
{
|
||||
if (self->evaluate_default != NULL ||
|
||||
(self->default_value != &_Ty_NoDefaultStruct && self->default_value != NULL)) {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -976,10 +976,10 @@ static TyObject *
|
||||
paramspecattr_richcompare(TyObject *a, TyObject *b, int op)
|
||||
{
|
||||
if (!Ty_IS_TYPE(a, Ty_TYPE(b))) {
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
if (op != Ty_EQ && op != Ty_NE) {
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
if (op != Py_EQ && op != Py_NE) {
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
paramspecattrobject *lhs = paramspecattrobject_CAST(a); // may be unsafe
|
||||
paramspecattrobject *rhs = (paramspecattrobject *)b; // safe fast cast
|
||||
@@ -987,7 +987,7 @@ paramspecattr_richcompare(TyObject *a, TyObject *b, int op)
|
||||
}
|
||||
|
||||
static TyMemberDef paramspecattr_members[] = {
|
||||
{"__origin__", _Ty_T_OBJECT, offsetof(paramspecattrobject, __origin__), Ty_READONLY},
|
||||
{"__origin__", _Ty_T_OBJECT, offsetof(paramspecattrobject, __origin__), Py_READONLY},
|
||||
{0}
|
||||
};
|
||||
|
||||
@@ -1219,30 +1219,30 @@ paramspec_repr(TyObject *self)
|
||||
}
|
||||
|
||||
static TyMemberDef paramspec_members[] = {
|
||||
{"__name__", _Ty_T_OBJECT, offsetof(paramspecobject, name), Ty_READONLY},
|
||||
{"__bound__", _Ty_T_OBJECT, offsetof(paramspecobject, bound), Ty_READONLY},
|
||||
{"__covariant__", Ty_T_BOOL, offsetof(paramspecobject, covariant), Ty_READONLY},
|
||||
{"__contravariant__", Ty_T_BOOL, offsetof(paramspecobject, contravariant), Ty_READONLY},
|
||||
{"__infer_variance__", Ty_T_BOOL, offsetof(paramspecobject, infer_variance), Ty_READONLY},
|
||||
{"__name__", _Ty_T_OBJECT, offsetof(paramspecobject, name), Py_READONLY},
|
||||
{"__bound__", _Ty_T_OBJECT, offsetof(paramspecobject, bound), Py_READONLY},
|
||||
{"__covariant__", Ty_T_BOOL, offsetof(paramspecobject, covariant), Py_READONLY},
|
||||
{"__contravariant__", Ty_T_BOOL, offsetof(paramspecobject, contravariant), Py_READONLY},
|
||||
{"__infer_variance__", Ty_T_BOOL, offsetof(paramspecobject, infer_variance), Py_READONLY},
|
||||
{0}
|
||||
};
|
||||
|
||||
static TyObject *
|
||||
paramspec_args(TyObject *self, void *Ty_UNUSED(closure))
|
||||
paramspec_args(TyObject *self, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *tp = _TyInterpreterState_GET()->cached_objects.paramspecargs_type;
|
||||
return (TyObject *)paramspecattr_new(tp, self);
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
paramspec_kwargs(TyObject *self, void *Ty_UNUSED(closure))
|
||||
paramspec_kwargs(TyObject *self, void *Py_UNUSED(closure))
|
||||
{
|
||||
TyTypeObject *tp = _TyInterpreterState_GET()->cached_objects.paramspeckwargs_type;
|
||||
return (TyObject *)paramspecattr_new(tp, self);
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
paramspec_default(TyObject *op, void *Ty_UNUSED(closure))
|
||||
paramspec_default(TyObject *op, void *Py_UNUSED(closure))
|
||||
{
|
||||
paramspecobject *self = paramspecobject_CAST(op);
|
||||
if (self->default_value != NULL) {
|
||||
@@ -1257,7 +1257,7 @@ paramspec_default(TyObject *op, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
paramspec_evaluate_default(TyObject *op, void *Ty_UNUSED(closure))
|
||||
paramspec_evaluate_default(TyObject *op, void *Py_UNUSED(closure))
|
||||
{
|
||||
paramspecobject *self = paramspecobject_CAST(op);
|
||||
if (self->evaluate_default != NULL) {
|
||||
@@ -1266,7 +1266,7 @@ paramspec_evaluate_default(TyObject *op, void *Ty_UNUSED(closure))
|
||||
if (self->default_value != NULL) {
|
||||
return constevaluator_alloc(self->default_value);
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyGetSetDef paramspec_getset[] = {
|
||||
@@ -1411,9 +1411,9 @@ paramspec_has_default_impl(paramspecobject *self)
|
||||
{
|
||||
if (self->evaluate_default != NULL ||
|
||||
(self->default_value != &_Ty_NoDefaultStruct && self->default_value != NULL)) {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -1555,7 +1555,7 @@ typevartuple_repr(TyObject *self)
|
||||
}
|
||||
|
||||
static TyMemberDef typevartuple_members[] = {
|
||||
{"__name__", _Ty_T_OBJECT, offsetof(typevartupleobject, name), Ty_READONLY},
|
||||
{"__name__", _Ty_T_OBJECT, offsetof(typevartupleobject, name), Py_READONLY},
|
||||
{0}
|
||||
};
|
||||
|
||||
@@ -1665,9 +1665,9 @@ typevartuple_has_default_impl(typevartupleobject *self)
|
||||
{
|
||||
if (self->evaluate_default != NULL ||
|
||||
(self->default_value != &_Ty_NoDefaultStruct && self->default_value != NULL)) {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
@@ -1700,7 +1700,7 @@ typevartuple_clear(TyObject *self)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
typevartuple_default(TyObject *op, void *Ty_UNUSED(closure))
|
||||
typevartuple_default(TyObject *op, void *Py_UNUSED(closure))
|
||||
{
|
||||
typevartupleobject *self = typevartupleobject_CAST(op);
|
||||
if (self->default_value != NULL) {
|
||||
@@ -1715,7 +1715,7 @@ typevartuple_default(TyObject *op, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
typevartuple_evaluate_default(TyObject *op, void *Ty_UNUSED(closure))
|
||||
typevartuple_evaluate_default(TyObject *op, void *Py_UNUSED(closure))
|
||||
{
|
||||
typevartupleobject *self = typevartupleobject_CAST(op);
|
||||
if (self->evaluate_default != NULL) {
|
||||
@@ -1724,7 +1724,7 @@ typevartuple_evaluate_default(TyObject *op, void *Ty_UNUSED(closure))
|
||||
if (self->default_value != NULL) {
|
||||
return constevaluator_alloc(self->default_value);
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyGetSetDef typevartuple_getset[] = {
|
||||
@@ -1814,14 +1814,14 @@ _Ty_make_typevar(TyObject *name, TyObject *evaluate_bound, TyObject *evaluate_co
|
||||
}
|
||||
|
||||
TyObject *
|
||||
_Ty_make_paramspec(PyThreadState *Ty_UNUSED(ignored), TyObject *v)
|
||||
_Ty_make_paramspec(PyThreadState *Py_UNUSED(ignored), TyObject *v)
|
||||
{
|
||||
assert(TyUnicode_Check(v));
|
||||
return (TyObject *)paramspec_alloc(v, NULL, NULL, false, false, true, NULL);
|
||||
}
|
||||
|
||||
TyObject *
|
||||
_Ty_make_typevartuple(PyThreadState *Ty_UNUSED(ignored), TyObject *v)
|
||||
_Ty_make_typevartuple(PyThreadState *Py_UNUSED(ignored), TyObject *v)
|
||||
{
|
||||
assert(TyUnicode_Check(v));
|
||||
return (TyObject *)typevartuple_alloc(v, NULL, NULL);
|
||||
@@ -1882,19 +1882,19 @@ typealias_repr(TyObject *self)
|
||||
}
|
||||
|
||||
static TyMemberDef typealias_members[] = {
|
||||
{"__name__", _Ty_T_OBJECT, offsetof(typealiasobject, name), Ty_READONLY},
|
||||
{"__name__", _Ty_T_OBJECT, offsetof(typealiasobject, name), Py_READONLY},
|
||||
{0}
|
||||
};
|
||||
|
||||
static TyObject *
|
||||
typealias_value(TyObject *self, void *Ty_UNUSED(closure))
|
||||
typealias_value(TyObject *self, void *Py_UNUSED(closure))
|
||||
{
|
||||
typealiasobject *ta = typealiasobject_CAST(self);
|
||||
return typealias_get_value(ta);
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
typealias_evaluate_value(TyObject *self, void *Ty_UNUSED(closure))
|
||||
typealias_evaluate_value(TyObject *self, void *Py_UNUSED(closure))
|
||||
{
|
||||
typealiasobject *ta = typealiasobject_CAST(self);
|
||||
if (ta->compute_value != NULL) {
|
||||
@@ -1905,7 +1905,7 @@ typealias_evaluate_value(TyObject *self, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
typealias_parameters(TyObject *self, void *Ty_UNUSED(closure))
|
||||
typealias_parameters(TyObject *self, void *Py_UNUSED(closure))
|
||||
{
|
||||
typealiasobject *ta = typealiasobject_CAST(self);
|
||||
if (ta->type_params == NULL) {
|
||||
@@ -1915,7 +1915,7 @@ typealias_parameters(TyObject *self, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
typealias_type_params(TyObject *self, void *Ty_UNUSED(closure))
|
||||
typealias_type_params(TyObject *self, void *Py_UNUSED(closure))
|
||||
{
|
||||
typealiasobject *ta = typealiasobject_CAST(self);
|
||||
if (ta->type_params == NULL) {
|
||||
@@ -1925,7 +1925,7 @@ typealias_type_params(TyObject *self, void *Ty_UNUSED(closure))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
typealias_module(TyObject *self, void *Ty_UNUSED(closure))
|
||||
typealias_module(TyObject *self, void *Py_UNUSED(closure))
|
||||
{
|
||||
typealiasobject *ta = typealiasobject_CAST(self);
|
||||
if (ta->module != NULL) {
|
||||
@@ -1940,7 +1940,7 @@ typealias_module(TyObject *self, void *Ty_UNUSED(closure))
|
||||
return Ty_NewRef(mod);
|
||||
}
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static TyGetSetDef typealias_getset[] = {
|
||||
|
||||
@@ -8854,13 +8854,13 @@ charmapencode_lookup(Ty_UCS4 c, TyObject *mapping, unsigned char *replace)
|
||||
Ty_DECREF(w);
|
||||
if (rc == 0) {
|
||||
/* No mapping found means: mapping is undefined. */
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
if (x == NULL) {
|
||||
if (TyErr_ExceptionMatches(TyExc_LookupError)) {
|
||||
/* No mapping found means: mapping is undefined. */
|
||||
TyErr_Clear();
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
} else
|
||||
return NULL;
|
||||
}
|
||||
@@ -11537,32 +11537,32 @@ TyUnicode_RichCompare(TyObject *left, TyObject *right, int op)
|
||||
int result;
|
||||
|
||||
if (!TyUnicode_Check(left) || !TyUnicode_Check(right))
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
|
||||
if (left == right) {
|
||||
switch (op) {
|
||||
case Ty_EQ:
|
||||
case Ty_LE:
|
||||
case Ty_GE:
|
||||
case Py_EQ:
|
||||
case Py_LE:
|
||||
case Py_GE:
|
||||
/* a string is equal to itself */
|
||||
Ty_RETURN_TRUE;
|
||||
case Ty_NE:
|
||||
case Ty_LT:
|
||||
case Ty_GT:
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_TRUE;
|
||||
case Py_NE:
|
||||
case Py_LT:
|
||||
case Py_GT:
|
||||
Py_RETURN_FALSE;
|
||||
default:
|
||||
TyErr_BadArgument();
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else if (op == Ty_EQ || op == Ty_NE) {
|
||||
else if (op == Py_EQ || op == Py_NE) {
|
||||
result = unicode_eq(left, right);
|
||||
result ^= (op == Ty_NE);
|
||||
result ^= (op == Py_NE);
|
||||
return TyBool_FromLong(result);
|
||||
}
|
||||
else {
|
||||
result = unicode_compare(left, right);
|
||||
Ty_RETURN_RICHCOMPARE(result, 0, op);
|
||||
Py_RETURN_RICHCOMPARE(result, 0, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12083,14 +12083,14 @@ unicode_islower_impl(TyObject *self)
|
||||
|
||||
/* Special case for empty strings */
|
||||
if (length == 0)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
cased = 0;
|
||||
for (i = 0; i < length; i++) {
|
||||
const Ty_UCS4 ch = TyUnicode_READ(kind, data, i);
|
||||
|
||||
if (Ty_UNICODE_ISUPPER(ch) || Ty_UNICODE_ISTITLE(ch))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
else if (!cased && Ty_UNICODE_ISLOWER(ch))
|
||||
cased = 1;
|
||||
}
|
||||
@@ -12126,14 +12126,14 @@ unicode_isupper_impl(TyObject *self)
|
||||
|
||||
/* Special case for empty strings */
|
||||
if (length == 0)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
cased = 0;
|
||||
for (i = 0; i < length; i++) {
|
||||
const Ty_UCS4 ch = TyUnicode_READ(kind, data, i);
|
||||
|
||||
if (Ty_UNICODE_ISLOWER(ch) || Ty_UNICODE_ISTITLE(ch))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
else if (!cased && Ty_UNICODE_ISUPPER(ch))
|
||||
cased = 1;
|
||||
}
|
||||
@@ -12171,7 +12171,7 @@ unicode_istitle_impl(TyObject *self)
|
||||
|
||||
/* Special case for empty strings */
|
||||
if (length == 0)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
cased = 0;
|
||||
previous_is_cased = 0;
|
||||
@@ -12180,13 +12180,13 @@ unicode_istitle_impl(TyObject *self)
|
||||
|
||||
if (Ty_UNICODE_ISUPPER(ch) || Ty_UNICODE_ISTITLE(ch)) {
|
||||
if (previous_is_cased)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
previous_is_cased = 1;
|
||||
cased = 1;
|
||||
}
|
||||
else if (Ty_UNICODE_ISLOWER(ch)) {
|
||||
if (!previous_is_cased)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
previous_is_cased = 1;
|
||||
cased = 1;
|
||||
}
|
||||
@@ -12224,14 +12224,14 @@ unicode_isspace_impl(TyObject *self)
|
||||
|
||||
/* Special case for empty strings */
|
||||
if (length == 0)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
for (i = 0; i < length; i++) {
|
||||
const Ty_UCS4 ch = TyUnicode_READ(kind, data, i);
|
||||
if (!Ty_UNICODE_ISSPACE(ch))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -12262,13 +12262,13 @@ unicode_isalpha_impl(TyObject *self)
|
||||
|
||||
/* Special case for empty strings */
|
||||
if (length == 0)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
for (i = 0; i < length; i++) {
|
||||
if (!Ty_UNICODE_ISALPHA(TyUnicode_READ(kind, data, i)))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -12300,14 +12300,14 @@ unicode_isalnum_impl(TyObject *self)
|
||||
|
||||
/* Special case for empty strings */
|
||||
if (len == 0)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
const Ty_UCS4 ch = TyUnicode_READ(kind, data, i);
|
||||
if (!Ty_UNICODE_ISALNUM(ch))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -12338,13 +12338,13 @@ unicode_isdecimal_impl(TyObject *self)
|
||||
|
||||
/* Special case for empty strings */
|
||||
if (length == 0)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
for (i = 0; i < length; i++) {
|
||||
if (!Ty_UNICODE_ISDECIMAL(TyUnicode_READ(kind, data, i)))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -12376,13 +12376,13 @@ unicode_isdigit_impl(TyObject *self)
|
||||
|
||||
/* Special case for empty strings */
|
||||
if (length == 0)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
for (i = 0; i < length; i++) {
|
||||
if (!Ty_UNICODE_ISDIGIT(TyUnicode_READ(kind, data, i)))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -12413,13 +12413,13 @@ unicode_isnumeric_impl(TyObject *self)
|
||||
|
||||
/* Special case for empty strings */
|
||||
if (length == 0)
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
for (i = 0; i < length; i++) {
|
||||
if (!Ty_UNICODE_ISNUMERIC(TyUnicode_READ(kind, data, i)))
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
Ty_ssize_t
|
||||
@@ -12508,10 +12508,10 @@ unicode_isprintable_impl(TyObject *self)
|
||||
|
||||
for (i = 0; i < length; i++) {
|
||||
if (!Ty_UNICODE_ISPRINTABLE(TyUnicode_READ(kind, data, i))) {
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
@@ -13620,11 +13620,11 @@ unicode_startswith_impl(TyObject *self, TyObject *subobj, Ty_ssize_t start,
|
||||
return NULL;
|
||||
}
|
||||
if (result) {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
}
|
||||
/* nothing matched */
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
if (!TyUnicode_Check(subobj)) {
|
||||
TyErr_Format(TyExc_TypeError,
|
||||
@@ -13676,10 +13676,10 @@ unicode_endswith_impl(TyObject *self, TyObject *subobj, Ty_ssize_t start,
|
||||
return NULL;
|
||||
}
|
||||
if (result) {
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
}
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
if (!TyUnicode_Check(subobj)) {
|
||||
TyErr_Format(TyExc_TypeError,
|
||||
@@ -14302,7 +14302,7 @@ unicode_sizeof_impl(TyObject *self)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
unicode_getnewargs(TyObject *v, TyObject *Ty_UNUSED(ignored))
|
||||
unicode_getnewargs(TyObject *v, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
TyObject *copy = _TyUnicode_Copy(v);
|
||||
if (!copy)
|
||||
@@ -14525,7 +14525,7 @@ static TyObject *
|
||||
unicode_mod(TyObject *v, TyObject *w)
|
||||
{
|
||||
if (!TyUnicode_Check(v))
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
return TyUnicode_Format(v, w);
|
||||
}
|
||||
|
||||
@@ -16289,7 +16289,7 @@ unicode_ascii_iter_next(TyObject *op)
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
unicodeiter_len(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
unicodeiter_len(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
unicodeiterobject *it = (unicodeiterobject *)op;
|
||||
Ty_ssize_t len = 0;
|
||||
@@ -16301,7 +16301,7 @@ unicodeiter_len(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).");
|
||||
|
||||
static TyObject *
|
||||
unicodeiter_reduce(TyObject *op, TyObject *Ty_UNUSED(ignored))
|
||||
unicodeiter_reduce(TyObject *op, TyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
unicodeiterobject *it = (unicodeiterobject *)op;
|
||||
TyObject *iter = _TyEval_GetBuiltin(&_Ty_ID(iter));
|
||||
@@ -16338,7 +16338,7 @@ unicodeiter_setstate(TyObject *op, TyObject *state)
|
||||
index = TyUnicode_GET_LENGTH(it->it_seq); /* iterator truncated */
|
||||
it->it_index = index;
|
||||
}
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(setstate_doc, "Set state information for unpickling.");
|
||||
|
||||
@@ -70,7 +70,7 @@ union_hash(TyObject *self)
|
||||
static int
|
||||
unions_equal(unionobject *a, unionobject *b)
|
||||
{
|
||||
int result = PyObject_RichCompareBool(a->hashable_args, b->hashable_args, Ty_EQ);
|
||||
int result = PyObject_RichCompareBool(a->hashable_args, b->hashable_args, Py_EQ);
|
||||
if (result == -1) {
|
||||
return -1;
|
||||
}
|
||||
@@ -112,15 +112,15 @@ unions_equal(unionobject *a, unionobject *b)
|
||||
static TyObject *
|
||||
union_richcompare(TyObject *a, TyObject *b, int op)
|
||||
{
|
||||
if (!_PyUnion_Check(b) || (op != Ty_EQ && op != Ty_NE)) {
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
if (!_PyUnion_Check(b) || (op != Py_EQ && op != Py_NE)) {
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
int equal = unions_equal((unionobject*)a, (unionobject*)b);
|
||||
if (equal == -1) {
|
||||
return NULL;
|
||||
}
|
||||
if (op == Ty_EQ) {
|
||||
if (op == Py_EQ) {
|
||||
return TyBool_FromLong(equal);
|
||||
}
|
||||
else {
|
||||
@@ -257,7 +257,7 @@ TyObject *
|
||||
_Ty_union_type_or(TyObject* self, TyObject* other)
|
||||
{
|
||||
if (!is_unionable(self) || !is_unionable(other)) {
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
unionbuilder ub;
|
||||
@@ -317,7 +317,7 @@ error:
|
||||
}
|
||||
|
||||
static TyMemberDef union_members[] = {
|
||||
{"__args__", _Ty_T_OBJECT, offsetof(unionobject, args), Ty_READONLY},
|
||||
{"__args__", _Ty_T_OBJECT, offsetof(unionobject, args), Py_READONLY},
|
||||
{0}
|
||||
};
|
||||
|
||||
@@ -360,7 +360,7 @@ static PyMappingMethods union_as_mapping = {
|
||||
};
|
||||
|
||||
static TyObject *
|
||||
union_parameters(TyObject *self, void *Ty_UNUSED(unused))
|
||||
union_parameters(TyObject *self, void *Py_UNUSED(unused))
|
||||
{
|
||||
unionobject *alias = (unionobject *)self;
|
||||
if (union_init_parameters(alias) < 0) {
|
||||
@@ -370,13 +370,13 @@ union_parameters(TyObject *self, void *Ty_UNUSED(unused))
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
union_name(TyObject *Ty_UNUSED(self), void *Ty_UNUSED(ignored))
|
||||
union_name(TyObject *Py_UNUSED(self), void *Py_UNUSED(ignored))
|
||||
{
|
||||
return TyUnicode_FromString("Union");
|
||||
}
|
||||
|
||||
static TyObject *
|
||||
union_origin(TyObject *Ty_UNUSED(self), void *Ty_UNUSED(ignored))
|
||||
union_origin(TyObject *Py_UNUSED(self), void *Py_UNUSED(ignored))
|
||||
{
|
||||
return Ty_NewRef(&_PyUnion_Type);
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ weakref_vectorcall(TyObject *self, TyObject *const *args,
|
||||
}
|
||||
TyObject *obj = _TyWeakref_GET_REF(self);
|
||||
if (obj == NULL) {
|
||||
Ty_RETURN_NONE;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
@@ -244,10 +244,10 @@ weakref_repr(TyObject *self)
|
||||
static TyObject *
|
||||
weakref_richcompare(TyObject* self, TyObject* other, int op)
|
||||
{
|
||||
if ((op != Ty_EQ && op != Ty_NE) ||
|
||||
if ((op != Py_EQ && op != Py_NE) ||
|
||||
!PyWeakref_Check(self) ||
|
||||
!PyWeakref_Check(other)) {
|
||||
Ty_RETURN_NOTIMPLEMENTED;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
TyObject* obj = _TyWeakref_GET_REF(self);
|
||||
TyObject* other_obj = _TyWeakref_GET_REF(other);
|
||||
@@ -255,12 +255,12 @@ weakref_richcompare(TyObject* self, TyObject* other, int op)
|
||||
Ty_XDECREF(obj);
|
||||
Ty_XDECREF(other_obj);
|
||||
int res = (self == other);
|
||||
if (op == Ty_NE)
|
||||
if (op == Py_NE)
|
||||
res = !res;
|
||||
if (res)
|
||||
Ty_RETURN_TRUE;
|
||||
Py_RETURN_TRUE;
|
||||
else
|
||||
Ty_RETURN_FALSE;
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
TyObject* res = PyObject_RichCompare(obj, other_obj, op);
|
||||
Ty_DECREF(obj);
|
||||
@@ -485,7 +485,7 @@ weakref___init__(TyObject *self, TyObject *args, TyObject *kwargs)
|
||||
|
||||
|
||||
static TyMemberDef weakref_members[] = {
|
||||
{"__callback__", _Ty_T_OBJECT, offsetof(PyWeakReference, wr_callback), Ty_READONLY},
|
||||
{"__callback__", _Ty_T_OBJECT, offsetof(PyWeakReference, wr_callback), Py_READONLY},
|
||||
{NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
@@ -586,7 +586,7 @@ proxy_check_ref(TyObject *obj)
|
||||
|
||||
#define WRAP_METHOD(method, SPECIAL) \
|
||||
static TyObject * \
|
||||
method(TyObject *proxy, TyObject *Ty_UNUSED(ignored)) { \
|
||||
method(TyObject *proxy, TyObject *Py_UNUSED(ignored)) { \
|
||||
UNWRAP(proxy); \
|
||||
TyObject* res = PyObject_CallMethodNoArgs(proxy, &_Ty_ID(SPECIAL)); \
|
||||
Ty_DECREF(proxy); \
|
||||
|
||||
Reference in New Issue
Block a user