• Home
  • Raw
  • Download

Lines Matching refs:lz

690     cycleobject *lz;  in cycle_new()  local
710 lz = (cycleobject *)type->tp_alloc(type, 0); in cycle_new()
711 if (lz == NULL) { in cycle_new()
716 lz->it = it; in cycle_new()
717 lz->saved = saved; in cycle_new()
718 lz->firstpass = 0; in cycle_new()
720 return (PyObject *)lz; in cycle_new()
724 cycle_dealloc(cycleobject *lz) in cycle_dealloc() argument
726 PyObject_GC_UnTrack(lz); in cycle_dealloc()
727 Py_XDECREF(lz->saved); in cycle_dealloc()
728 Py_XDECREF(lz->it); in cycle_dealloc()
729 Py_TYPE(lz)->tp_free(lz); in cycle_dealloc()
733 cycle_traverse(cycleobject *lz, visitproc visit, void *arg) in cycle_traverse() argument
735 Py_VISIT(lz->it); in cycle_traverse()
736 Py_VISIT(lz->saved); in cycle_traverse()
741 cycle_next(cycleobject *lz) in cycle_next() argument
748 item = PyIter_Next(lz->it); in cycle_next()
750 if (!lz->firstpass && PyList_Append(lz->saved, item)) { in cycle_next()
762 if (PyList_Size(lz->saved) == 0) in cycle_next()
764 it = PyObject_GetIter(lz->saved); in cycle_next()
767 tmp = lz->it; in cycle_next()
768 lz->it = it; in cycle_next()
769 lz->firstpass = 1; in cycle_next()
841 dropwhileobject *lz; in dropwhile_new() local
855 lz = (dropwhileobject *)type->tp_alloc(type, 0); in dropwhile_new()
856 if (lz == NULL) { in dropwhile_new()
861 lz->func = func; in dropwhile_new()
862 lz->it = it; in dropwhile_new()
863 lz->start = 0; in dropwhile_new()
865 return (PyObject *)lz; in dropwhile_new()
869 dropwhile_dealloc(dropwhileobject *lz) in dropwhile_dealloc() argument
871 PyObject_GC_UnTrack(lz); in dropwhile_dealloc()
872 Py_XDECREF(lz->func); in dropwhile_dealloc()
873 Py_XDECREF(lz->it); in dropwhile_dealloc()
874 Py_TYPE(lz)->tp_free(lz); in dropwhile_dealloc()
878 dropwhile_traverse(dropwhileobject *lz, visitproc visit, void *arg) in dropwhile_traverse() argument
880 Py_VISIT(lz->it); in dropwhile_traverse()
881 Py_VISIT(lz->func); in dropwhile_traverse()
886 dropwhile_next(dropwhileobject *lz) in dropwhile_next() argument
889 PyObject *it = lz->it; in dropwhile_next()
898 if (lz->start == 1) in dropwhile_next()
901 good = PyObject_CallFunctionObjArgs(lz->func, item, NULL); in dropwhile_next()
909 lz->start = 1; in dropwhile_next()
985 takewhileobject *lz; in takewhile_new() local
999 lz = (takewhileobject *)type->tp_alloc(type, 0); in takewhile_new()
1000 if (lz == NULL) { in takewhile_new()
1005 lz->func = func; in takewhile_new()
1006 lz->it = it; in takewhile_new()
1007 lz->stop = 0; in takewhile_new()
1009 return (PyObject *)lz; in takewhile_new()
1013 takewhile_dealloc(takewhileobject *lz) in takewhile_dealloc() argument
1015 PyObject_GC_UnTrack(lz); in takewhile_dealloc()
1016 Py_XDECREF(lz->func); in takewhile_dealloc()
1017 Py_XDECREF(lz->it); in takewhile_dealloc()
1018 Py_TYPE(lz)->tp_free(lz); in takewhile_dealloc()
1022 takewhile_traverse(takewhileobject *lz, visitproc visit, void *arg) in takewhile_traverse() argument
1024 Py_VISIT(lz->it); in takewhile_traverse()
1025 Py_VISIT(lz->func); in takewhile_traverse()
1030 takewhile_next(takewhileobject *lz) in takewhile_next() argument
1033 PyObject *it = lz->it; in takewhile_next()
1036 if (lz->stop == 1) in takewhile_next()
1043 good = PyObject_CallFunctionObjArgs(lz->func, item, NULL); in takewhile_next()
1054 lz->stop = 1; in takewhile_next()
1129 isliceobject *lz; in islice_new() local
1189 lz = (isliceobject *)type->tp_alloc(type, 0); in islice_new()
1190 if (lz == NULL) { in islice_new()
1194 lz->it = it; in islice_new()
1195 lz->next = start; in islice_new()
1196 lz->stop = stop; in islice_new()
1197 lz->step = step; in islice_new()
1198 lz->cnt = 0L; in islice_new()
1200 return (PyObject *)lz; in islice_new()
1204 islice_dealloc(isliceobject *lz) in islice_dealloc() argument
1206 PyObject_GC_UnTrack(lz); in islice_dealloc()
1207 Py_XDECREF(lz->it); in islice_dealloc()
1208 Py_TYPE(lz)->tp_free(lz); in islice_dealloc()
1212 islice_traverse(isliceobject *lz, visitproc visit, void *arg) in islice_traverse() argument
1214 Py_VISIT(lz->it); in islice_traverse()
1219 islice_next(isliceobject *lz) in islice_next() argument
1222 PyObject *it = lz->it; in islice_next()
1223 Py_ssize_t stop = lz->stop; in islice_next()
1231 while (lz->cnt < lz->next) { in islice_next()
1236 lz->cnt++; in islice_next()
1238 if (stop != -1 && lz->cnt >= stop) in islice_next()
1243 lz->cnt++; in islice_next()
1244 oldnext = lz->next; in islice_next()
1247 lz->next += (size_t)lz->step; in islice_next()
1248 if (lz->next < oldnext || (stop != -1 && lz->next > stop)) in islice_next()
1249 lz->next = stop; in islice_next()
1253 Py_CLEAR(lz->it); in islice_next()
1327 starmapobject *lz; in starmap_new() local
1341 lz = (starmapobject *)type->tp_alloc(type, 0); in starmap_new()
1342 if (lz == NULL) { in starmap_new()
1347 lz->func = func; in starmap_new()
1348 lz->it = it; in starmap_new()
1350 return (PyObject *)lz; in starmap_new()
1354 starmap_dealloc(starmapobject *lz) in starmap_dealloc() argument
1356 PyObject_GC_UnTrack(lz); in starmap_dealloc()
1357 Py_XDECREF(lz->func); in starmap_dealloc()
1358 Py_XDECREF(lz->it); in starmap_dealloc()
1359 Py_TYPE(lz)->tp_free(lz); in starmap_dealloc()
1363 starmap_traverse(starmapobject *lz, visitproc visit, void *arg) in starmap_traverse() argument
1365 Py_VISIT(lz->it); in starmap_traverse()
1366 Py_VISIT(lz->func); in starmap_traverse()
1371 starmap_next(starmapobject *lz) in starmap_next() argument
1375 PyObject *it = lz->it; in starmap_next()
1387 result = PyObject_Call(lz->func, args, NULL); in starmap_next()
1457 imapobject *lz; in imap_new() local
1485 lz = (imapobject *)type->tp_alloc(type, 0); in imap_new()
1486 if (lz == NULL) { in imap_new()
1490 lz->iters = iters; in imap_new()
1493 lz->func = func; in imap_new()
1495 return (PyObject *)lz; in imap_new()
1499 imap_dealloc(imapobject *lz) in imap_dealloc() argument
1501 PyObject_GC_UnTrack(lz); in imap_dealloc()
1502 Py_XDECREF(lz->iters); in imap_dealloc()
1503 Py_XDECREF(lz->func); in imap_dealloc()
1504 Py_TYPE(lz)->tp_free(lz); in imap_dealloc()
1508 imap_traverse(imapobject *lz, visitproc visit, void *arg) in imap_traverse() argument
1510 Py_VISIT(lz->iters); in imap_traverse()
1511 Py_VISIT(lz->func); in imap_traverse()
1541 imap_next(imapobject *lz) in imap_next() argument
1548 numargs = PyTuple_Size(lz->iters); in imap_next()
1554 val = PyIter_Next(PyTuple_GET_ITEM(lz->iters, i)); in imap_next()
1561 if (lz->func == Py_None) in imap_next()
1563 result = PyObject_Call(lz->func, argtuple, NULL); in imap_next()
1635 chainobject *lz; in chain_new_internal() local
1637 lz = (chainobject *)type->tp_alloc(type, 0); in chain_new_internal()
1638 if (lz == NULL) { in chain_new_internal()
1643 lz->source = source; in chain_new_internal()
1644 lz->active = NULL; in chain_new_internal()
1645 return (PyObject *)lz; in chain_new_internal()
1676 chain_dealloc(chainobject *lz) in chain_dealloc() argument
1678 PyObject_GC_UnTrack(lz); in chain_dealloc()
1679 Py_XDECREF(lz->active); in chain_dealloc()
1680 Py_XDECREF(lz->source); in chain_dealloc()
1681 Py_TYPE(lz)->tp_free(lz); in chain_dealloc()
1685 chain_traverse(chainobject *lz, visitproc visit, void *arg) in chain_traverse() argument
1687 Py_VISIT(lz->source); in chain_traverse()
1688 Py_VISIT(lz->active); in chain_traverse()
1693 chain_next(chainobject *lz) in chain_next() argument
1700 while (lz->source != NULL) { in chain_next()
1701 if (lz->active == NULL) { in chain_next()
1702 PyObject *iterable = PyIter_Next(lz->source); in chain_next()
1704 Py_CLEAR(lz->source); in chain_next()
1707 lz->active = PyObject_GetIter(iterable); in chain_next()
1709 if (lz->active == NULL) { in chain_next()
1710 Py_CLEAR(lz->source); in chain_next()
1714 item = PyIter_Next(lz->active); in chain_next()
1724 Py_CLEAR(lz->active); in chain_next()
1809 productobject *lz; in product_new() local
1870 lz = (productobject *)type->tp_alloc(type, 0); in product_new()
1871 if (lz == NULL) in product_new()
1874 lz->pools = pools; in product_new()
1875 lz->indices = indices; in product_new()
1876 lz->result = NULL; in product_new()
1877 lz->stopped = 0; in product_new()
1879 return (PyObject *)lz; in product_new()
1889 product_dealloc(productobject *lz) in product_dealloc() argument
1891 PyObject_GC_UnTrack(lz); in product_dealloc()
1892 Py_XDECREF(lz->pools); in product_dealloc()
1893 Py_XDECREF(lz->result); in product_dealloc()
1894 if (lz->indices != NULL) in product_dealloc()
1895 PyMem_Free(lz->indices); in product_dealloc()
1896 Py_TYPE(lz)->tp_free(lz); in product_dealloc()
1900 product_traverse(productobject *lz, visitproc visit, void *arg) in product_traverse() argument
1902 Py_VISIT(lz->pools); in product_traverse()
1903 Py_VISIT(lz->result); in product_traverse()
1908 product_next(productobject *lz) in product_next() argument
1913 PyObject *pools = lz->pools; in product_next()
1914 PyObject *result = lz->result; in product_next()
1918 if (lz->stopped) in product_next()
1927 lz->result = result; in product_next()
1937 Py_ssize_t *indices = lz->indices; in product_next()
1945 lz->result = result; in product_next()
1990 lz->stopped = 1; in product_next()
2811 compressobject *lz; in compress_new() local
2825 lz = (compressobject *)type->tp_alloc(type, 0); in compress_new()
2826 if (lz == NULL) in compress_new()
2828 lz->data = data; in compress_new()
2829 lz->selectors = selectors; in compress_new()
2830 return (PyObject *)lz; in compress_new()
2839 compress_dealloc(compressobject *lz) in compress_dealloc() argument
2841 PyObject_GC_UnTrack(lz); in compress_dealloc()
2842 Py_XDECREF(lz->data); in compress_dealloc()
2843 Py_XDECREF(lz->selectors); in compress_dealloc()
2844 Py_TYPE(lz)->tp_free(lz); in compress_dealloc()
2848 compress_traverse(compressobject *lz, visitproc visit, void *arg) in compress_traverse() argument
2850 Py_VISIT(lz->data); in compress_traverse()
2851 Py_VISIT(lz->selectors); in compress_traverse()
2856 compress_next(compressobject *lz) in compress_next() argument
2858 PyObject *data = lz->data, *selectors = lz->selectors; in compress_next()
2958 ifilterobject *lz; in ifilter_new() local
2972 lz = (ifilterobject *)type->tp_alloc(type, 0); in ifilter_new()
2973 if (lz == NULL) { in ifilter_new()
2978 lz->func = func; in ifilter_new()
2979 lz->it = it; in ifilter_new()
2981 return (PyObject *)lz; in ifilter_new()
2985 ifilter_dealloc(ifilterobject *lz) in ifilter_dealloc() argument
2987 PyObject_GC_UnTrack(lz); in ifilter_dealloc()
2988 Py_XDECREF(lz->func); in ifilter_dealloc()
2989 Py_XDECREF(lz->it); in ifilter_dealloc()
2990 Py_TYPE(lz)->tp_free(lz); in ifilter_dealloc()
2994 ifilter_traverse(ifilterobject *lz, visitproc visit, void *arg) in ifilter_traverse() argument
2996 Py_VISIT(lz->it); in ifilter_traverse()
2997 Py_VISIT(lz->func); in ifilter_traverse()
3002 ifilter_next(ifilterobject *lz) in ifilter_next() argument
3005 PyObject *it = lz->it; in ifilter_next()
3015 if (lz->func == Py_None || lz->func == (PyObject *)&PyBool_Type) { in ifilter_next()
3019 good = PyObject_CallFunctionObjArgs(lz->func, in ifilter_next()
3102 ifilterfalseobject *lz; in ifilterfalse_new() local
3117 lz = (ifilterfalseobject *)type->tp_alloc(type, 0); in ifilterfalse_new()
3118 if (lz == NULL) { in ifilterfalse_new()
3123 lz->func = func; in ifilterfalse_new()
3124 lz->it = it; in ifilterfalse_new()
3126 return (PyObject *)lz; in ifilterfalse_new()
3130 ifilterfalse_dealloc(ifilterfalseobject *lz) in ifilterfalse_dealloc() argument
3132 PyObject_GC_UnTrack(lz); in ifilterfalse_dealloc()
3133 Py_XDECREF(lz->func); in ifilterfalse_dealloc()
3134 Py_XDECREF(lz->it); in ifilterfalse_dealloc()
3135 Py_TYPE(lz)->tp_free(lz); in ifilterfalse_dealloc()
3139 ifilterfalse_traverse(ifilterfalseobject *lz, visitproc visit, void *arg) in ifilterfalse_traverse() argument
3141 Py_VISIT(lz->it); in ifilterfalse_traverse()
3142 Py_VISIT(lz->func); in ifilterfalse_traverse()
3147 ifilterfalse_next(ifilterfalseobject *lz) in ifilterfalse_next() argument
3150 PyObject *it = lz->it; in ifilterfalse_next()
3160 if (lz->func == Py_None || lz->func == (PyObject *)&PyBool_Type) { in ifilterfalse_next()
3164 good = PyObject_CallFunctionObjArgs(lz->func, in ifilterfalse_next()
3263 countobject *lz; in count_new() local
3321 lz = (countobject *)type->tp_alloc(type, 0); in count_new()
3322 if (lz == NULL) { in count_new()
3326 lz->cnt = cnt; in count_new()
3327 lz->long_cnt = long_cnt; in count_new()
3328 lz->long_step = long_step; in count_new()
3330 return (PyObject *)lz; in count_new()
3334 count_dealloc(countobject *lz) in count_dealloc() argument
3336 PyObject_GC_UnTrack(lz); in count_dealloc()
3337 Py_XDECREF(lz->long_cnt); in count_dealloc()
3338 Py_XDECREF(lz->long_step); in count_dealloc()
3339 Py_TYPE(lz)->tp_free(lz); in count_dealloc()
3343 count_traverse(countobject *lz, visitproc visit, void *arg) in count_traverse() argument
3345 Py_VISIT(lz->long_cnt); in count_traverse()
3346 Py_VISIT(lz->long_step); in count_traverse()
3351 count_nextlong(countobject *lz) in count_nextlong() argument
3356 long_cnt = lz->long_cnt; in count_nextlong()
3363 assert(lz->cnt == PY_SSIZE_T_MAX && long_cnt != NULL); in count_nextlong()
3365 stepped_up = PyNumber_Add(long_cnt, lz->long_step); in count_nextlong()
3368 lz->long_cnt = stepped_up; in count_nextlong()
3373 count_next(countobject *lz) in count_next() argument
3375 if (lz->cnt == PY_SSIZE_T_MAX) in count_next()
3376 return count_nextlong(lz); in count_next()
3377 return PyInt_FromSsize_t(lz->cnt++); in count_next()
3381 count_repr(countobject *lz) in count_repr() argument
3386 if (lz->cnt != PY_SSIZE_T_MAX) in count_repr()
3387 return PyString_FromFormat("count(%zd)", lz->cnt); in count_repr()
3389 cnt_repr = PyObject_Repr(lz->long_cnt); in count_repr()
3393 if (PyInt_Check(lz->long_step) && PyInt_AS_LONG(lz->long_step) == 1) { in count_repr()
3398 step_repr = PyObject_Repr(lz->long_step); in count_repr()
3410 count_reduce(countobject *lz) in count_reduce() argument
3412 if (lz->cnt == PY_SSIZE_T_MAX) in count_reduce()
3413 return Py_BuildValue("O(OO)", Py_TYPE(lz), lz->long_cnt, lz->long_step); in count_reduce()
3414 return Py_BuildValue("O(n)", Py_TYPE(lz), lz->cnt); in count_reduce()
3497 izipobject *lz; in izip_new() local
3539 lz = (izipobject *)type->tp_alloc(type, 0); in izip_new()
3540 if (lz == NULL) { in izip_new()
3545 lz->ittuple = ittuple; in izip_new()
3546 lz->tuplesize = tuplesize; in izip_new()
3547 lz->result = result; in izip_new()
3549 return (PyObject *)lz; in izip_new()
3553 izip_dealloc(izipobject *lz) in izip_dealloc() argument
3555 PyObject_GC_UnTrack(lz); in izip_dealloc()
3556 Py_XDECREF(lz->ittuple); in izip_dealloc()
3557 Py_XDECREF(lz->result); in izip_dealloc()
3558 Py_TYPE(lz)->tp_free(lz); in izip_dealloc()
3562 izip_traverse(izipobject *lz, visitproc visit, void *arg) in izip_traverse() argument
3564 Py_VISIT(lz->ittuple); in izip_traverse()
3565 Py_VISIT(lz->result); in izip_traverse()
3570 izip_next(izipobject *lz) in izip_next() argument
3573 Py_ssize_t tuplesize = lz->tuplesize; in izip_next()
3574 PyObject *result = lz->result; in izip_next()
3584 it = PyTuple_GET_ITEM(lz->ittuple, i); in izip_next()
3599 it = PyTuple_GET_ITEM(lz->ittuple, i); in izip_next()
3832 iziplongestobject *lz; in izip_longest_new() local
3881 lz = (iziplongestobject *)type->tp_alloc(type, 0); in izip_longest_new()
3882 if (lz == NULL) { in izip_longest_new()
3887 lz->ittuple = ittuple; in izip_longest_new()
3888 lz->tuplesize = tuplesize; in izip_longest_new()
3889 lz->numactive = tuplesize; in izip_longest_new()
3890 lz->result = result; in izip_longest_new()
3892 lz->fillvalue = fillvalue; in izip_longest_new()
3893 return (PyObject *)lz; in izip_longest_new()
3897 izip_longest_dealloc(iziplongestobject *lz) in izip_longest_dealloc() argument
3899 PyObject_GC_UnTrack(lz); in izip_longest_dealloc()
3900 Py_XDECREF(lz->ittuple); in izip_longest_dealloc()
3901 Py_XDECREF(lz->result); in izip_longest_dealloc()
3902 Py_XDECREF(lz->fillvalue); in izip_longest_dealloc()
3903 Py_TYPE(lz)->tp_free(lz); in izip_longest_dealloc()
3907 izip_longest_traverse(iziplongestobject *lz, visitproc visit, void *arg) in izip_longest_traverse() argument
3909 Py_VISIT(lz->ittuple); in izip_longest_traverse()
3910 Py_VISIT(lz->result); in izip_longest_traverse()
3911 Py_VISIT(lz->fillvalue); in izip_longest_traverse()
3916 izip_longest_next(iziplongestobject *lz) in izip_longest_next() argument
3919 Py_ssize_t tuplesize = lz->tuplesize; in izip_longest_next()
3920 PyObject *result = lz->result; in izip_longest_next()
3927 if (lz->numactive == 0) in izip_longest_next()
3932 it = PyTuple_GET_ITEM(lz->ittuple, i); in izip_longest_next()
3934 Py_INCREF(lz->fillvalue); in izip_longest_next()
3935 item = lz->fillvalue; in izip_longest_next()
3939 lz->numactive -= 1; in izip_longest_next()
3940 if (lz->numactive == 0 || PyErr_Occurred()) { in izip_longest_next()
3941 lz->numactive = 0; in izip_longest_next()
3945 Py_INCREF(lz->fillvalue); in izip_longest_next()
3946 item = lz->fillvalue; in izip_longest_next()
3947 PyTuple_SET_ITEM(lz->ittuple, i, NULL); in izip_longest_next()
3961 it = PyTuple_GET_ITEM(lz->ittuple, i); in izip_longest_next()
3963 Py_INCREF(lz->fillvalue); in izip_longest_next()
3964 item = lz->fillvalue; in izip_longest_next()
3968 lz->numactive -= 1; in izip_longest_next()
3969 if (lz->numactive == 0 || PyErr_Occurred()) { in izip_longest_next()
3970 lz->numactive = 0; in izip_longest_next()
3974 Py_INCREF(lz->fillvalue); in izip_longest_next()
3975 item = lz->fillvalue; in izip_longest_next()
3976 PyTuple_SET_ITEM(lz->ittuple, i, NULL); in izip_longest_next()