@@ -1427,105 +1427,6 @@ static int init_moduletype(void)
1427
1427
#define initchain init_moduletype
1428
1428
1429
1429
1430
- /******************************************************
1431
-
1432
- pickling of iterators
1433
-
1434
- ******************************************************/
1435
-
1436
- /* XXX make sure this copy is always up to date */
1437
- typedef struct {
1438
- PyObject_HEAD
1439
- long it_index ;
1440
- PyObject * it_seq ;
1441
- } seqiterobject ;
1442
-
1443
- static PyTypeObject wrap_PySeqIter_Type ;
1444
-
1445
- static PyObject *
1446
- iter_reduce (seqiterobject * iterator )
1447
- {
1448
- PyObject * tup ;
1449
- tup = Py_BuildValue ("(O(Ol)())" ,
1450
- & wrap_PySeqIter_Type ,
1451
- iterator -> it_seq ,
1452
- iterator -> it_index );
1453
- return tup ;
1454
- }
1455
-
1456
- static PyObject *
1457
- iter_new (PyTypeObject * type , PyObject * args , PyObject * kwds )
1458
- {
1459
- PyObject * iter , * seq ;
1460
- long index ;
1461
-
1462
- if (is_wrong_type (type )) return NULL ;
1463
- if (!PyArg_ParseTuple (args , "Ol:iter" , & seq , & index )) return NULL ;
1464
- iter = PySeqIter_New (seq );
1465
- if (iter != NULL ) {
1466
- ((seqiterobject * ) iter )-> it_index = index ;
1467
- iter -> ob_type = type ;
1468
- }
1469
- return iter ;
1470
- }
1471
-
1472
- MAKE_WRAPPERTYPE (PySeqIter_Type , iter , "iterator" , iter_reduce , iter_new ,
1473
- generic_setstate )
1474
-
1475
- /* XXX make sure this copy is always up to date */
1476
- typedef struct {
1477
- PyObject_HEAD
1478
- PyObject * it_callable ; /* Set to NULL when iterator is exhausted */
1479
- PyObject * it_sentinel ; /* Set to NULL when iterator is exhausted */
1480
- } calliterobject ;
1481
-
1482
- static PyTypeObject wrap_PyCallIter_Type ;
1483
- static PyObject *
1484
- calliter_reduce (calliterobject * iterator )
1485
- {
1486
- PyObject * tup ;
1487
- tup = Py_BuildValue ("(O(OO)" NO_STATE_FORMAT ")" ,
1488
- & wrap_PyCallIter_Type ,
1489
- iterator -> it_callable ? iterator -> it_callable : Py_None ,
1490
- iterator -> it_sentinel ? iterator -> it_sentinel : Py_None
1491
- NO_STATE_ARG );
1492
- return tup ;
1493
- }
1494
-
1495
- static
1496
- PyObject *
1497
- calliter_new (PyTypeObject * type , PyObject * args , PyObject * kwds )
1498
- {
1499
- calliterobject * it ;
1500
- PyObject * it_callable ;
1501
- PyObject * it_sentinel ;
1502
-
1503
- if (is_wrong_type (type )) return NULL ;
1504
- if (!PyArg_ParseTuple (args , "OO:calliter" , & it_callable ,
1505
- & it_sentinel ))
1506
- return NULL ;
1507
-
1508
- if (it_callable == Py_None ) it_callable = NULL ;
1509
- if (it_sentinel == Py_None ) it_sentinel = NULL ;
1510
-
1511
- it = (calliterobject * ) PyCallIter_New (it_callable , it_sentinel );
1512
- if (it != NULL )
1513
- Py_TYPE (it ) = type ;
1514
- return (PyObject * ) it ;
1515
- }
1516
-
1517
- MAKE_WRAPPERTYPE (PyCallIter_Type , calliter , "callable_iterator" ,
1518
- calliter_reduce , calliter_new , generic_setstate )
1519
-
1520
- static int init_itertype (void )
1521
- {
1522
- return init_type (& wrap_PySeqIter_Type , NULL )
1523
- || init_type (& wrap_PyCallIter_Type , initchain );
1524
- }
1525
- #undef initchain
1526
- #define initchain init_itertype
1527
-
1528
-
1529
1430
/******************************************************
1530
1431
1531
1432
pickling of class/instance methods (PyMethod)
0 commit comments