We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aca4670 commit 0509c45Copy full SHA for 0509c45
Objects/typeobject.c
@@ -7661,8 +7661,17 @@ update_slot(PyTypeObject *type, PyObject *name)
7661
assert(slotdefs_initialized);
7662
pp = ptrs;
7663
for (p = slotdefs; p->name; p++) {
7664
- if (p->name_strobj == name)
+ assert(PyUnicode_CheckExact(p->name_strobj));
7665
+ assert(PyUnicode_CheckExact(name));
7666
+#ifdef INTERN_NAME_STRINGS
7667
+ if (p->name_strobj == name) {
7668
+ *pp++ = p;
7669
+ }
7670
+#else
7671
+ if (p->name_strobj == name || _PyUnicode_EQ(p->name_strobj, name)) {
7672
*pp++ = p;
7673
7674
+#endif
7675
}
7676
*pp = NULL;
7677
for (pp = ptrs; *pp; pp++) {
0 commit comments