Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(83)

Delta Between Two Patch Sets: Objects/typeobject.c

Issue 22986: Improved handling of __class__ assignment
Left Patch Set: Created 5 years, 1 month ago
Right Patch Set: Created 5 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Lib/test/test_module.py ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* Type object implementation */ 1 /* Type object implementation */
2 2
3 #include "Python.h" 3 #include "Python.h"
4 #include "frameobject.h" 4 #include "frameobject.h"
5 #include "structmember.h" 5 #include "structmember.h"
6 6
7 #include <ctype.h> 7 #include <ctype.h>
8 8
9 9
10 /* Support type attribute cache */ 10 /* Support type attribute cache */
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 type = Py_TYPE(self); 1189 type = Py_TYPE(self);
1190 1190
1191 /* Call the base tp_dealloc(); first retrack self if 1191 /* Call the base tp_dealloc(); first retrack self if
1192 * basedealloc knows about gc. 1192 * basedealloc knows about gc.
1193 */ 1193 */
1194 if (PyType_IS_GC(base)) 1194 if (PyType_IS_GC(base))
1195 _PyObject_GC_TRACK(self); 1195 _PyObject_GC_TRACK(self);
1196 assert(basedealloc); 1196 assert(basedealloc);
1197 basedealloc(self); 1197 basedealloc(self);
1198 1198
1199 /* Can't reference self beyond this point */ 1199 /* Can't reference self beyond this point. It's possible tp_del switched
1200 Py_DECREF(type); 1200 our type from a HEAPTYPE to a non-HEAPTYPE, so be careful about
1201 reference counting. */
1202 if (type->tp_flags & Py_TPFLAGS_HEAPTYPE)
1203 Py_DECREF(type);
1201 1204
1202 endlabel: 1205 endlabel:
1203 ++_PyTrash_delete_nesting; 1206 ++_PyTrash_delete_nesting;
1204 ++ tstate->trash_delete_nesting; 1207 ++ tstate->trash_delete_nesting;
1205 Py_TRASHCAN_SAFE_END(self); 1208 Py_TRASHCAN_SAFE_END(self);
1206 --_PyTrash_delete_nesting; 1209 --_PyTrash_delete_nesting;
1207 -- tstate->trash_delete_nesting; 1210 -- tstate->trash_delete_nesting;
1208 1211
1209 /* Explanation of the weirdness around the trashcan macros: 1212 /* Explanation of the weirdness around the trashcan macros:
1210 1213
(...skipping 5930 matching lines...) Expand 10 before | Expand all | Expand 10 after
7141 0, /* tp_base */ 7144 0, /* tp_base */
7142 0, /* tp_dict */ 7145 0, /* tp_dict */
7143 super_descr_get, /* tp_descr_get */ 7146 super_descr_get, /* tp_descr_get */
7144 0, /* tp_descr_set */ 7147 0, /* tp_descr_set */
7145 0, /* tp_dictoffset */ 7148 0, /* tp_dictoffset */
7146 super_init, /* tp_init */ 7149 super_init, /* tp_init */
7147 PyType_GenericAlloc, /* tp_alloc */ 7150 PyType_GenericAlloc, /* tp_alloc */
7148 PyType_GenericNew, /* tp_new */ 7151 PyType_GenericNew, /* tp_new */
7149 PyObject_GC_Del, /* tp_free */ 7152 PyObject_GC_Del, /* tp_free */
7150 }; 7153 };
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+