Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5e8ffe1

Browse filesBrowse files
authored
bpo-39573: Use Py_IS_TYPE to check for types (GH-19882)
1 parent 846d8b2 commit 5e8ffe1
Copy full SHA for 5e8ffe1

File tree

Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed

‎Objects/genericaliasobject.c

Copy file name to clipboardExpand all lines: Objects/genericaliasobject.c
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,8 @@ ga_getattro(PyObject *self, PyObject *name)
424424
static PyObject *
425425
ga_richcompare(PyObject *a, PyObject *b, int op)
426426
{
427-
if (Py_TYPE(a) != &Py_GenericAliasType ||
428-
Py_TYPE(b) != &Py_GenericAliasType ||
427+
if (!Py_IS_TYPE(a, &Py_GenericAliasType) ||
428+
!Py_IS_TYPE(b, &Py_GenericAliasType) ||
429429
(op != Py_EQ && op != Py_NE))
430430
{
431431
Py_RETURN_NOTIMPLEMENTED;

‎Objects/typeobject.c

Copy file name to clipboardExpand all lines: Objects/typeobject.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6306,7 +6306,7 @@ FUNCNAME(PyObject *self, PyObject *other) \
63066306
stack[1] = other; \
63076307
r = vectorcall_maybe(tstate, &op_id, stack, 2); \
63086308
if (r != Py_NotImplemented || \
6309-
Py_TYPE(other) == Py_TYPE(self)) \
6309+
Py_IS_TYPE(other, Py_TYPE(self))) \
63106310
return r; \
63116311
Py_DECREF(r); \
63126312
} \

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.