Zackery Spytz
0523c39e77
bpo-36430: Fix a possible reference leak in itertools.count(). (GH-12551)
7 years ago
Sergey Fedoseev
234531b446
bpo-36030: Add _PyTuple_FromArray() function (GH-11954)
7 years ago
Serhiy Storchaka
a24107b04c
bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112)
7 years ago
Serhiy Storchaka
bb86bf4c4e
bpo-35444: Unify and optimize the helper for getting a builtin object. (GH-11047)
This speeds up pickling of some iterators.
This fixes also error handling in pickling methods when fail to
look up builtin "getattr".
7 years ago
Lisa Roach
9718b59ee5
bpo-34659: Adds initial kwarg to itertools.accumulate() (GH-9345)
7 years ago
Tal Einat
c4bccd3c76
bpo-20180: convert most of itertoolsmodule.c to use Argument Clinic (GH-9164)
7 years ago
Tal Einat
3286ce4ade
bpo-20180: itertools.groupby Argument Clinic conversion (GH-4170)
7 years ago
Siddhesh Poyarekar
55edd0c185
bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (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.
8 years ago
oldk
aa0735f597
bpo-32747: Remove trailing spaces in docstrings. (GH-5491)
8 years ago
Serhiy Storchaka
f320be77ff
bpo-32571: Avoid raising unneeded AttributeError and silencing it in C code (GH-5222)
Add two new private APIs: _PyObject_LookupAttr() and _PyObject_LookupAttrId()
8 years ago
Serhiy Storchaka
1707e4020f
bpo-31572: Silence only AttributeError when get the __copy__ attribute in itertools.tee(). ( #3724 )
8 years ago
Serhiy Storchaka
c740e4fe8a
bpo-30347: Stop crashes when concurrently iterate over itertools.groupby() iterators. ( #1557 )
8 years ago
Raymond Hettinger
49392c63a2
bpo-27385: Clarify docstring for groupby() ( #3738 )
8 years ago
Serhiy Storchaka
c247caf33f
bpo-30346: An iterator produced by the itertools.groupby() iterator ( #1569 )
now becames exhausted after advancing the groupby iterator.
8 years ago
Serhiy Storchaka
b3a77964ea
bpo-27541: Reprs of subclasses of some classes now contain actual type name. ( #3631 )
Affected classes are bytearray, array, deque, defaultdict, count and repeat.
8 years ago
Serhiy Storchaka
4ab46d7949
bpo-31497: Add private helper _PyType_Name(). ( #3630 )
This function returns the last component of tp_name after a dot.
Returns tp_name itself if it doesn't contain a dot.
8 years ago
Serhiy Storchaka
6cca5c8459
bpo-30592: Fixed error messages for some builtins. ( #1996 )
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.
9 years ago
Will Roberts
0ecdc52514
bpo-30537: use PyNumber in itertools.islice instead of PyLong ( #1918 )
* 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
9 years ago
Serhiy Storchaka
bf623ae884
bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() ( #1096 )
raised an error.
Replace them with using concrete types API that never fails if appropriate.
9 years ago
T. Wouters
5466d4af5f
bpo-29942: Fix the use of recursion in itertools.chain.from_iterable. ( #889 )
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.
9 years ago
Serhiy Storchaka
ba85d69a3e
bpo-29878: Add global instances of int for 0 and 1. ( #852 )
9 years ago
Serhiy Storchaka
fff9a31a91
bpo-29865: Use PyXXX_GET_SIZE macros rather than Py_SIZE for concrete types. ( #748 )
9 years ago
Serhiy Storchaka
5ab81d787f
Issue #28959 : Added private macro PyDict_GET_SIZE for retrieving the size of dict.
9 years ago
Victor Stinner
de4ae3d486
Backed out changeset b9c9691c72c5
Issue #28858 : The change b9c9691c72c5 introduced a regression. It seems like
_PyObject_CallArg1() uses more stack memory than
PyObject_CallFunctionObjArgs().
9 years ago
Victor Stinner
27580c1fb5
Replace PyObject_CallFunctionObjArgs() with fastcall
* 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 .
9 years ago
Serhiy Storchaka
85c3f268f4
Issue #28322 : Fixed possible crashes when unpickle itertools objects from
incorrect pickle data. Based on patch by John Leitch.
9 years ago
Serhiy Storchaka
8ddcf3abf7
Issue #28019 : itertools.count() no longer rounds non-integer step in range
between 1.0 and 2.0 to 1.
9 years ago
Martin Panter
eb9957065a
Issue #27626 : Spelling fixes in docs, comments and internal names
Based on patch by Ville Skyttä.
10 years ago
Serhiy Storchaka
6a7b3a77b4
Issue #26778 : Fixed "a/an/and" typos in code comment and documentation.
10 years ago
Serhiy Storchaka
57a01d3a0e
Issue #26200 : Added Py_SETREF and replaced Py_XSETREF with Py_SETREF
in places where Py_DECREF was used.
10 years ago
Serhiy Storchaka
48842714b9
Issue #22570 : Renamed Py_SETREF to Py_XSETREF.
10 years ago
Serhiy Storchaka
d55162517d
Issue #25718 : Fixed pickling and copying the accumulate() iterator with total is None.
10 years ago
Benjamin Peterson
0e617e22f0
remove some copyright notices supserseded by the toplevel ones
10 years ago
Serhiy Storchaka
1ed017ae92
Issue #20440 : Cleaning up the code by using Py_SETREF and Py_CLEAR.
Old code is correct, but with Py_SETREF and Py_CLEAR it can be cleaner.
This patch doesn't fix bugs and hence there is no need to backport it.
10 years ago
Serhiy Storchaka
4a1e70fc31
Issue #20440 : Applied yet one patch for using Py_SETREF.
The patch is automatically generated, it replaces the code that uses Py_CLEAR.
10 years ago
Serhiy Storchaka
5a57ade58e
Issue #20440 : Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
10 years ago
Serhiy Storchaka
5c4064e8bd
Issue #25421 : __sizeof__ methods of builtin types now use dynamic basic size.
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
10 years ago
Serhiy Storchaka
d65c9496da
Issue #25523 : Further a-to-an corrections.
10 years ago
Kristján Valur Jónsson
102764a1f6
Issue #25021 : Correctly make sure that product.__setstate__ does not access
invalid memory.
10 years ago
Raymond Hettinger
a6ea44aed1
Minor cleanups
11 years ago
Raymond Hettinger
ca3788c2e8
Issue #24874 : Speed-up itertools and make it pickles more compact.
11 years ago
Raymond Hettinger
a6a2d44dc7
Neaten-up whitespace, vertical alignment, and line-wrapping.
11 years ago
Raymond Hettinger
b5244a3fe5
Inline PyIter_Next() matching what was done for other itertools.
11 years ago
Raymond Hettinger
c39786dc08
Fix oddly placed whitespace
11 years ago
Raymond Hettinger
98958fedb6
Remove dead code (unreachable)
11 years ago
Raymond Hettinger
79c878d5f2
Fix crash in itertools.cycle.__setstate__() caused by lack of type checking.
Will backport after the 3.6 release is done.
11 years ago
Raymond Hettinger
b468e1f595
Neaten-up vertical alignment of comments
11 years ago
Raymond Hettinger
acd61b6e40
Issue #24735 : Fix invalid memory access in combinations_with_replacement()
11 years ago
Serhiy Storchaka
d741a88049
Fixed indentation of Python examples in C comments.
11 years ago
Serhiy Storchaka
483405bcca
Issue #22883 : Got rid of outdated references to PyInt and PyString in comments.
11 years ago