File tree 2 files changed +3
-56
lines changed
2 files changed +3
-56
lines changed Original file line number Diff line number Diff line change @@ -1418,49 +1418,12 @@ static PyGetSetDef WCharArray_getsets[] = {
1418
1418
};
1419
1419
1420
1420
/*
1421
- The next three functions copied from Python's typeobject.c.
1421
+ The next function is copied from Python's typeobject.c.
1422
1422
1423
- They are used to attach methods, members, or getsets to a type *after* it
1423
+ It is used to attach getsets to a type *after* it
1424
1424
has been created: Arrays of characters have additional getsets to treat them
1425
1425
as strings.
1426
1426
*/
1427
- /*
1428
- static int
1429
- add_methods(PyTypeObject *type, PyMethodDef *meth)
1430
- {
1431
- PyObject *dict = type->tp_dict;
1432
- for (; meth->ml_name != NULL; meth++) {
1433
- PyObject *descr;
1434
- descr = PyDescr_NewMethod(type, meth);
1435
- if (descr == NULL)
1436
- return -1;
1437
- if (PyDict_SetItemString(dict, meth->ml_name, descr) < 0) {
1438
- Py_DECREF(descr);
1439
- return -1;
1440
- }
1441
- Py_DECREF(descr);
1442
- }
1443
- return 0;
1444
- }
1445
-
1446
- static int
1447
- add_members(PyTypeObject *type, PyMemberDef *memb)
1448
- {
1449
- PyObject *dict = type->tp_dict;
1450
- for (; memb->name != NULL; memb++) {
1451
- PyObject *descr;
1452
- descr = PyDescr_NewMember(type, memb);
1453
- if (descr == NULL)
1454
- return -1;
1455
- if (PyDict_SetItemString(dict, memb->name, descr) < 0) {
1456
- Py_DECREF(descr);
1457
- return -1;
1458
- }
1459
- Py_DECREF(descr);
1460
- }
1461
- return 0;
1462
- }
1463
- */
1464
1427
1465
1428
static int
1466
1429
add_getset (PyTypeObject * type , PyGetSetDef * gsp )
Original file line number Diff line number Diff line change @@ -516,22 +516,6 @@ instancemethod_repr(PyObject *self)
516
516
return result ;
517
517
}
518
518
519
- /*
520
- static long
521
- instancemethod_hash(PyObject *self)
522
- {
523
- long x, y;
524
- x = (long)self;
525
- y = PyObject_Hash(PyInstanceMethod_GET_FUNCTION(self));
526
- if (y == -1)
527
- return -1;
528
- x = x ^ y;
529
- if (x == -1)
530
- x = -2;
531
- return x;
532
- }
533
- */
534
-
535
519
PyDoc_STRVAR (instancemethod_doc ,
536
520
"instancemethod(function)\n\
537
521
\n\
@@ -569,7 +553,7 @@ PyTypeObject PyInstanceMethod_Type = {
569
553
0 , /* tp_as_number */
570
554
0 , /* tp_as_sequence */
571
555
0 , /* tp_as_mapping */
572
- 0 , /*(hashfunc)instancemethod_hash, tp_hash */
556
+ 0 , /* tp_hash */
573
557
instancemethod_call , /* tp_call */
574
558
0 , /* tp_str */
575
559
instancemethod_getattro , /* tp_getattro */
You can’t perform that action at this time.
0 commit comments