| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
which breaks negative counts
* added test for negative numbers
will backport to 2.5.1
|
|
|
|
| |
Needs backport to 2.5.1 and earlier.
|
|
|
|
|
|
| |
Ensure that dataobj is never NULL.
Reported by Klocwork #102
|
|
|
|
| |
looked duplicated, I wonder if a utility function could help reduce the duplication here.)
|
| |
|
|
|
|
|
|
|
|
|
| |
not be tracked by GC. This fixes 254 of test_generators' refleaks on my
machine, but I'm sure something else will make them come back :>
Not adding a separate test for this kind of cycle, since the existing
fib/m235 already test them in more extensive ways than any 'minimal' test
has been able to manage.
|
|
|
|
|
| |
alone does not solve the leak in test_generators, unfortunately, but it is
part of test_generators' problem and it does solve other cycles.
|
| |
|
| |
|
|
|
|
| |
http://mail.python.org/pipermail/python-dev/2006-February/060524.html
|
|
|
|
| |
Probably should be backported.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In C++, it's an error to pass a string literal to a char* function
without a const_cast(). Rather than require every C++ extension
module to put a cast around string literals, fix the API to state the
const-ness.
I focused on parts of the API where people usually pass literals:
PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type
slots, etc. Predictably, there were a large set of functions that
needed to be fixed as a result of these changes. The most pervasive
change was to make the keyword args list passed to
PyArg_ParseTupleAndKewords() to be a const char *kwlist[].
One cast was required as a result of the changes: A type object
mallocs the memory for its tp_doc slot and later frees it.
PyTypeObject says that tp_doc is const char *; but if the type was
created by type_new(), we know it is safe to cast to char *.
|
| |
|
|
|
|
| |
(fixes bug #1119418)
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
* Have groupby() be careful about decreffing structure members.
|
|
|
|
| |
(Contributed by Dima Dorfman)
|
| |
|
|
|
|
|
|
|
| |
Both cycle() and chain() were handling exceptions only when switching
input sources. The patch makes the handle more immediate.
Will backport.
|
|
|
|
| |
instead of %d .
|
| |
|
|
|
|
| |
ifilterfalse().
|
| |
|
| |
|
|
|
|
|
|
|
| |
Original idea by Guido van Rossum.
Idea for skipable inner iterators by Raymond Hettinger.
Idea for argument order and identity function default by Alex Martelli.
Implementation by Hye-Shik Chang (with tweaks by Raymond Hettinger).
|
|
|
|
|
|
|
|
|
|
|
| |
Formerly, underlying queue was implemented in terms of two lists. The
new queue is a series of singly-linked fixed length lists.
The new implementation runs much faster, supports multi-way tees, and
allows tees of tees without additional memory costs.
The root ideas for this structure were contributed by Andrew Koenig
and Guido van Rossum.
|
| |
|
|
|
|
|
|
| |
* tee object is no longer subclassable
* independent iterators renamed to "itertools.tee_iterator"
* fixed doc string typo and added entry in the module doc string
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add error checking code to PyList_Append() call.
* Replace PyObject_CallMethod(to->outbasket, "pop", NULL) with equivalent
in-line code. Inlining is important here because the search for the
pop method will occur for every element returned by the iterator.
* Make tee's dealloc() a little smarter. If the trailing iterator is
being deallocated, then the queue data is no longer needed and can
be freed.
|
|
|
|
|
|
| |
It works like the pure python verion except:
* it stops storing data after of the iterators gets deallocated
* the data queue is implemented with two stacks instead of one dictionary.
|
| |
|
|
|
|
| |
Avoid Armin Rigo's dastardly exercise in re-entrancy.
|
|
|
|
| |
which can now take zero arguments.
|
|
|
|
| |
(Contributed by Andrew I MacIntyre.)
|
|
|
|
|
|
| |
* Updated comment on design of imap()
* Added untraversed object in izip() structure
* Replaced the pairwise() example with a more general window() example
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
the itertoolsmodule.
* Taught itertools.repeat(obj, n) to treat negative repeat counts as
zero. This behavior matches that for sequences and prevents
infinite loops.
|
|
|
|
| |
It is better to be explicit and just allow stop to be None.
|
|
|
|
|
| |
* itertools.islice() stop argument did not perform as documented.
* beefed-up test suite
|
| |
|
|
|
|
|
|
| |
to more accurately describe what the function does.
Suggested by Thomas Wouters.
|
|
|
|
| |
Factors out the common case of returning self.
|
| |
|
|
|
|
|
| |
Subsumed times() into repeat().
Added cycle() and chain().
|
| |
|