Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d55657b

Browse files
committed
Added comments before recently added/assigned slots in the type object,
so the backward compatibility issues will be easier to understand. I only added comments indicating additions and assignments back to Python 2.0.
1 parent 88dcf03 commit d55657b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Include/object.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ typedef struct {
150150
unaryfunc nb_float;
151151
unaryfunc nb_oct;
152152
unaryfunc nb_hex;
153+
/* Added in release 2.0 */
153154
binaryfunc nb_inplace_add;
154155
binaryfunc nb_inplace_subtract;
155156
binaryfunc nb_inplace_multiply;
@@ -162,6 +163,7 @@ typedef struct {
162163
binaryfunc nb_inplace_xor;
163164
binaryfunc nb_inplace_or;
164165

166+
/* Added in release 2.2 */
165167
/* The following require the Py_TPFLAGS_HAVE_CLASS flag */
166168
binaryfunc nb_floor_divide;
167169
binaryfunc nb_true_divide;
@@ -178,6 +180,7 @@ typedef struct {
178180
intobjargproc sq_ass_item;
179181
intintobjargproc sq_ass_slice;
180182
objobjproc sq_contains;
183+
/* Added in release 2.0 */
181184
binaryfunc sq_inplace_concat;
182185
intargfunc sq_inplace_repeat;
183186
} PySequenceMethods;
@@ -250,18 +253,21 @@ typedef struct _typeobject {
250253

251254
char *tp_doc; /* Documentation string */
252255

256+
/* Assigned meaning in release 2.0 */
253257
/* call function for all accessible objects */
254258
traverseproc tp_traverse;
255259

256260
/* delete references to contained objects */
257261
inquiry tp_clear;
258262

263+
/* Assigned meaning in release 2.1 */
259264
/* rich comparisons */
260265
richcmpfunc tp_richcompare;
261266

262267
/* weak reference enabler */
263268
long tp_weaklistoffset;
264269

270+
/* Added in release 2.2 */
265271
/* Iterators */
266272
getiterfunc tp_iter;
267273
iternextfunc tp_iternext;

0 commit comments

Comments
 (0)