summaryrefslogtreecommitdiffstats
path: root/Modules/itertoolsmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-40268: Remove unused structmember.h includes (GH-19530)Victor Stinner2020-04-151-1/+1
| | | | | | If only offsetof() is needed: include stddef.h instead. When structmember.h is used, add a comment explaining that PyMemberDef is used.
* Generic itertools.chain (GH-19417)Ethan Smith2020-04-101-0/+2
|
* bpo-40036: Deleting duplicates in itertoolsmodule.c (GH-18958)AlphaHot2020-03-231-26/+0
|
* bpo-40024: Add PyModule_AddType() helper function (GH-19088)Dong-hee Na2020-03-221-11/+3
|
* bpo-1635741: Port itertools module to multiphase initialization (GH-19044)Dong-hee Na2020-03-171-35/+42
|
* bpo-39573: Use Py_IS_TYPE() macro to check for types (GH-18809)Andy Lester2020-03-061-1/+1
| | | Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-39573: Finish converting to new Py_IS_TYPE() macro (GH-18601)Andy Lester2020-03-041-1/+1
|
* bpo-39245: Switch to public API for Vectorcall (GH-18460)Petr Viktorin2020-02-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The bulk of this patch was generated automatically with: for name in \ PyObject_Vectorcall \ Py_TPFLAGS_HAVE_VECTORCALL \ PyObject_VectorcallMethod \ PyVectorcall_Function \ PyObject_CallOneArg \ PyObject_CallMethodNoArgs \ PyObject_CallMethodOneArg \ ; do echo $name git grep -lwz _$name | xargs -0 sed -i "s/\b_$name\b/$name/g" done old=_PyObject_FastCallDict new=PyObject_VectorcallDict git grep -lwz $old | xargs -0 sed -i "s/\b$old\b/$new/g" and then cleaned up: - Revert changes to in docs & news - Revert changes to backcompat defines in headers - Nudge misaligned comments
* bpo-39573: Add Py_SET_TYPE() function (GH-18394)Victor Stinner2020-02-071-3/+5
| | | Add Py_SET_TYPE() function to set the type of an object.
* Minor readability improvement for argument handling in itertools.repeat() ↵Raymond Hettinger2019-11-101-5/+5
| | | | | | (GH-17101)
* Permutations Python code equivalent in comment was invalid for Python 3 ↵Sergey2019-10-291-3/+6
| | | | (GH-16927)
* bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625)Serhiy Storchaka2019-09-091-0/+9
| | | | RuntimeError is now raised in this case.
* Revert "Raise a RuntimeError when tee iterator is consumed from different ↵Serhiy Storchaka2019-09-091-8/+0
| | | | | threads (GH-15567)" (GH-15736) This reverts commit fa220ec7633e9674baccc28dde987f29d7f65141.
* bpo-15999: Clean up of handling boolean arguments. (GH-15610)Serhiy Storchaka2019-09-011-3/+3
| | | | | | * Use the 'p' format unit instead of manually called PyObject_IsTrue(). * Pass boolean value instead 0/1 integers to functions that needs boolean. * Convert some arguments to boolean only once.
* bpo-37976: Prevent shadowing of TypeError in zip() (GH-15592)Sergey Fedoseev2019-08-301-4/+0
|
* Raise a RuntimeError when tee iterator is consumed from different threads ↵HongWeipeng2019-08-291-0/+8
| | | | (GH-15567)
* bpo-37483: add _PyObject_CallOneArg() function (#14558)Jeroen Demeyer2019-07-041-4/+4
|
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-311-40/+40
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-36430: Fix a possible reference leak in itertools.count(). (GH-12551)Zackery Spytz2019-03-261-0/+1
|
* bpo-36030: Add _PyTuple_FromArray() function (GH-11954)Sergey Fedoseev2019-02-251-24/+5
|
* bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112)Serhiy Storchaka2019-02-251-4/+10
|
* bpo-35444: Unify and optimize the helper for getting a builtin object. ↵Serhiy Storchaka2018-12-111-1/+2
| | | | | | | | (GH-11047) This speeds up pickling of some iterators. This fixes also error handling in pickling methods when fail to look up builtin "getattr".
* bpo-34659: Adds initial kwarg to itertools.accumulate() (GH-9345)Lisa Roach2018-09-241-3/+29
|
* bpo-20180: convert most of itertoolsmodule.c to use Argument Clinic (GH-9164)Tal Einat2018-09-111-218/+245
|
* bpo-20180: itertools.groupby Argument Clinic conversion (GH-4170)Tal Einat2018-09-101-23/+41
|
* bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. ↵Siddhesh Poyarekar2018-04-291-23/+23
| | | | | | | | | (GH-6030) METH_NOARGS functions need only a single argument but they are cast into a PyCFunction, which takes two arguments. This triggers an invalid function cast warning in gcc8 due to the argument mismatch. Fix this by adding a dummy unused argument.
* bpo-32747: Remove trailing spaces in docstrings. (GH-5491)oldk2018-02-021-5/+5
|
* bpo-32571: Avoid raising unneeded AttributeError and silencing it in C code ↵Serhiy Storchaka2018-01-251-6/+4
| | | | | (GH-5222) Add two new private APIs: _PyObject_LookupAttr() and _PyObject_LookupAttrId()
* bpo-31572: Silence only AttributeError when get the __copy__ attribute in ↵Serhiy Storchaka2017-11-111-7/+25
| | | | itertools.tee(). (#3724)
* bpo-30347: Stop crashes when concurrently iterate over itertools.groupby() ↵Serhiy Storchaka2017-09-261-36/+31
| | | | iterators. (#1557)
* bpo-27385: Clarify docstring for groupby() (#3738)Raymond Hettinger2017-09-251-2/+3
|
* bpo-30346: An iterator produced by the itertools.groupby() iterator (#1569)Serhiy Storchaka2017-09-241-0/+8
| | | now becames exhausted after advancing the groupby iterator.
* bpo-27541: Reprs of subclasses of some classes now contain actual type name. ↵Serhiy Storchaka2017-09-211-6/+13
| | | | | (#3631) Affected classes are bytearray, array, deque, defaultdict, count and repeat.
* bpo-31497: Add private helper _PyType_Name(). (#3630)Serhiy Storchaka2017-09-171-4/+3
| | | | This function returns the last component of tp_name after a dot. Returns tp_name itself if it doesn't contain a dot.
* bpo-30592: Fixed error messages for some builtins. (#1996)Serhiy Storchaka2017-06-081-7/+7
| | | | | Error messages when pass keyword arguments to some builtins that don't support keyword arguments contained double parenthesis: "()()". The regression was introduced by bpo-30534.
* bpo-30537: use PyNumber in itertools.islice instead of PyLong (#1918)Will Roberts2017-06-081-4/+4
| | | | | | | | * bpo-30537: use PyNumber in itertools instead of PyLong * bpo-30537: revert changes except to islice_new * bpo-30537: test itertools.islice and add entry to Misc/NEWS
* bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096)Serhiy Storchaka2017-04-191-1/+2
| | | | | | raised an error. Replace them with using concrete types API that never fails if appropriate.
* bpo-29942: Fix the use of recursion in itertools.chain.from_iterable. (#889)T. Wouters2017-03-301-24/+28
| | | | | Fix the use of recursion in itertools.chain.from_iterable. Using recursion is unnecessary, and can easily cause stack overflows, especially when building in low optimization modes or with Py_DEBUG enabled.
* bpo-29878: Add global instances of int for 0 and 1. (#852)Serhiy Storchaka2017-03-301-13/+5
|
* bpo-29865: Use PyXXX_GET_SIZE macros rather than Py_SIZE for concrete types. ↵Serhiy Storchaka2017-03-211-2/+2
| | | | (#748)
* Issue #28959: Added private macro PyDict_GET_SIZE for retrieving the size of ↵Serhiy Storchaka2016-12-161-3/+3
| | | | dict.
* Backed out changeset b9c9691c72c5Victor Stinner2016-12-041-5/+5
| | | | | | Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like _PyObject_CallArg1() uses more stack memory than PyObject_CallFunctionObjArgs().
* Replace PyObject_CallFunctionObjArgs() with fastcallVictor Stinner2016-12-011-5/+5
| | | | | | | | | | | | | | * PyObject_CallFunctionObjArgs(func, NULL) => _PyObject_CallNoArg(func) * PyObject_CallFunctionObjArgs(func, arg, NULL) => _PyObject_CallArg1(func, arg) PyObject_CallFunctionObjArgs() allocates 40 bytes on the C stack and requires extra work to "parse" C arguments to build a C array of PyObject*. _PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate memory on the C stack. This change is part of the fastcall project. The change on listsort() is related to the issue #23507.
* Issue #28322: Fixed possible crashes when unpickle itertools objects fromSerhiy Storchaka2016-10-021-6/+34
|\ | | | | | | incorrect pickle data. Based on patch by John Leitch.
| * Issue #28322: Fixed possible crashes when unpickle itertools objects fromSerhiy Storchaka2016-10-021-5/+35
| | | | | | | | incorrect pickle data. Based on patch by John Leitch.
* | Issue #28019: itertools.count() no longer rounds non-integer step in rangeSerhiy Storchaka2016-09-101-16/+29
|\ \ | |/ | | | | between 1.0 and 2.0 to 1.
| * Issue #28019: itertools.count() no longer rounds non-integer step in rangeSerhiy Storchaka2016-09-101-16/+29
| | | | | | | | between 1.0 and 2.0 to 1.
* | Issue #27626: Merge spelling fixes from 3.5Martin Panter2016-07-281-1/+1
|\ \ | |/
| * Issue #27626: Spelling fixes in docs, comments and internal namesMartin Panter2016-07-281-1/+1
| | | | | | | | Based on patch by Ville Skyttä.
* | Issue #26778: Fixed "a/an/and" typos in code comment, documentation and errorSerhiy Storchaka2016-04-171-1/+1
|\ \ | |/ | | | | messages.