summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_deque.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #27626: Spelling fixes in docs, comments and internal namesMartin Panter2016-07-281-1/+1
| | | | Based on patch by Ville Skyttä.
* Fixed test_sizeof for deque.Serhiy Storchaka2016-05-181-2/+2
|
* Issue #26494: Fixed crash on iterating exhausting iterators.Serhiy Storchaka2016-03-301-0/+4
| | | | | Affected classes are generic sequence iterators, iterators of bytearray, list, tuple, set, frozenset, dict, OrderedDict and corresponding views.
* Issue #22777: Test pickling with all protocols.Serhiy Storchaka2014-12-151-10/+12
|
* Restore the data block size to 62.Raymond Hettinger2013-07-281-1/+1
| | | | | | | | | | | | The former block size traded away good fit within cache lines in order to gain faster division in deque_item(). However, compilers are getting smarter and can now replace the slow division operation with a fast integer multiply and right shift. Accordingly, it makes sense to go back to a size that lets blocks neatly fill entire cache-lines. GCC-4.8 and CLANG 4.0 both compute "x // 62" with something roughly equivalent to "x * 9520900167075897609 >> 69".
* reapply 5accb0ac8bfbBenjamin Peterson2013-06-251-1/+1
|
* backout 5accb0ac8bfb; needs more discussion on python-devBenjamin Peterson2013-06-221-1/+1
|
* Fix comment blocks. Adjust blocksize to a power-of-two for better divmod ↵Raymond Hettinger2013-06-141-1/+1
| | | | computations.
* Closes #15469: Correct __sizeof__ support for dequeJesus Cea2012-08-031-0/+16
|
* Issue 11004: Fix edge case for deque.count().Raymond Hettinger2011-01-251-0/+9
|
* Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-1/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
* Expand test coverage for deque.count().Raymond Hettinger2010-04-031-0/+17
|
* Add count() method to collections.deque().Raymond Hettinger2010-04-031-0/+7
|
* Remove unused imports in test modules.Georg Brandl2010-02-071-1/+0
|
* use assert[Not]In where appropriateEzio Melotti2010-01-231-3/+3
|
* Add a reverse() method to collections.deque().Raymond Hettinger2009-12-101-0/+12
|
* Fix variants of deque.extend: d.extend(d) d+=d d.extendleft(d)Raymond Hettinger2009-12-101-0/+11
|
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-5/+5
|
* For collections.deque() objects, expose the maxlen parameter as a read-only ↵Raymond Hettinger2009-03-101-0/+10
| | | | attribute.
* Small optimization for corner case where maxlen==0.Raymond Hettinger2009-03-101-1/+18
|
* fill in actual issue number in testsAntoine Pitrou2009-01-011-1/+1
|
* Issue #3680: Reference cycles created through a dict, set or deque iterator ↵Antoine Pitrou2009-01-011-2/+19
| | | | did not get collected.
* Issue #4740: Use HIGHEST_PROTOCOL in pickle test.Hirokazu Yamamoto2008-12-271-2/+2
| | | | (There is no behavior difference in 2.x because HIGHEST_PROTOCOL == 2)
* Remove the test file before writing it in case there is no write permission.Neal Norwitz2008-04-101-0/+2
| | | | | | This might help fix some of the failures on Windows box(es). It doesn't hurt either way and ensure the tests are a little more self contained (ie have less assumptions).
* Fix a bunch of UnboundLocalErrors when the tests fail.Neal Norwitz2008-03-251-6/+6
|
* Patch #2167 from calvin: Remove unused importsChristian Heimes2008-02-231-1/+0
|
* Fix bug 1604. deque.__init__() did not clear existing contents like ↵Raymond Hettinger2007-12-131-4/+4
| | | | list.__init__. Not a backport candidate.
* Accept Jim Jewett's api suggestion to use None instead of -1 to indicate ↵Raymond Hettinger2007-10-101-1/+18
| | | | unbounded deques.
* Add __asdict__() to NamedTuple and refine the docs.Raymond Hettinger2007-10-051-26/+64
| | | | | | Add maxlen support to deque() and fixup docs. Partially fix __reduce__(). The None as a third arg was no longer supported. Still needs work on __reduce__() to handle recursive inputs.
* Bug #1486663: don't reject keyword arguments for subclasses of builtinGeorg Brandl2007-01-211-0/+11
| | | | types.
* Fix zero-length corner case for iterating over a mutating deque.Raymond Hettinger2007-01-081-0/+6
|
* Add tests for tuple, list and UserList that initialize the object fromWalter Dörwald2005-03-221-83/+7
| | | | | | various iterables. (Copied from test_deque.py as suggested by Jim Jewett in SF bug #1166274)
* Fix typo.Walter Dörwald2005-03-221-1/+1
|
* Apply remove's mutation test after every equality test.Raymond Hettinger2005-03-191-7/+8
|
* Add a remove() method to collections.deque objects.Raymond Hettinger2005-03-181-0/+35
|
* SF patch #1062279: deque pickling problemsRaymond Hettinger2004-11-091-4/+36
| | | | | | | (Contributed by Dima Dorfman.) * Support pickling of dictionaries in instances of deque subclasses. * Support pickling of recursive deques.
* Upon insertion, if memory runs out, the deque was left in a corrupted state.Armin Rigo2004-10-021-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | deque_item(): a performance bug: the linked list of blocks was followed from the left in most cases, because the test (i < (deque->len >> 1)) was after "i %= BLOCKLEN". deque_clear(): replaced a call to deque_len() with deque->len; not sure what this call was here for, nor if all compilers under the sun would inline it. deque_traverse(): I belive that it could be called by the GC when the deque has leftblock==rightblock==NULL, because it is tracked before the first block is allocated (though closely before). Still, a C extension module subclassing deque could provide its own tp_alloc that could trigger a GC collection after the PyObject_GC_Track()... deque_richcompare(): rewrote to cleanly check for end-of-iterations instead of relying on deque.__iter__().next() to succeed exactly len(deque) times -- an assumption which can break if deques are subclassed. Added a test. I wonder if the length should be explicitely bounded to INT_MAX, with OverflowErrors, as in listobject.c. On 64-bit machines, adding more than INT_MAX in the deque will result in trouble. (Note to anyone/me fixing this: carefully check for overflows if len is close to INT_MAX in the following functions: deque_rotate(), deque_item(), deque_ass_item())
* deque_traverse(): If the deque had one block, and its rightindex wasTim Peters2004-10-011-0/+9
| | | | | BLOCKLEN-1, this assert-failed in a debug build, or went wild with a NULL pointer in a release build. Reported on c.l.py by Stefan Behnel.
* Use floor division operator.Raymond Hettinger2004-09-271-1/+1
|
* Remove unnecessary line.Raymond Hettinger2004-08-261-1/+0
|
* * balance the left/right search for getitem.Raymond Hettinger2004-07-091-4/+31
| | | | | * use assertions instead of tests after internal calls that can't fail. * expand test coverage
* Make sets and deques weak referencable.Raymond Hettinger2004-05-301-0/+7
|
* SF patch #872326: Generator expression implementationRaymond Hettinger2004-05-191-1/+1
| | | | | | | | | | | | | | (Code contributed by Jiwon Seo.) The documentation portion of the patch is being re-worked and will be checked-in soon. Likewise, PEP 289 will be updated to reflect Guido's rationale for the design decisions on binding behavior (as described in in his patch comments and in discussions on python-dev). The test file, test_genexps.py, is written in doctest format and is meant to exercise all aspects of the the patch. Further additions are welcome from everyone. Please stress test this new feature as much as possible before the alpha release.
* Make sure "del d[n]" is properly supported. Was necessary because theRaymond Hettinger2004-05-121-3/+14
| | | | | | same method that implements __setitem__ also implements __delitem__. Also, there were several good use cases (removing items from a queue and implementing Forth style stack ops).
* Temporarily disable doctest until genexps are in CVSRaymond Hettinger2004-05-101-1/+1
|
* Add more examples.Raymond Hettinger2004-05-091-0/+51
|
* Replace left(), right(), and __reversed__() with the more general purposeRaymond Hettinger2004-03-011-9/+34
| | | | | | | __getitem__() and __setitem__(). Simplifies the API, reduces the code size, adds flexibility, and makes deques work with bisect.bisect(), random.shuffle(), and random.sample().
* Improvements to collections.deque():Raymond Hettinger2004-02-291-3/+89
| | | | | | | | * Add doctests for the examples in the library reference. * Add two methods, left() and right(), modeled after deques in C++ STL. * Apply the new method to asynchat.py. * Add comparison operators to make deques more substitutable for lists. * Replace the LookupErrors with IndexErrors to more closely match lists.
* Make deque.rotate() smarter. Beef-up related tests.Raymond Hettinger2004-02-081-9/+43
|
* * Incorporate Skip's suggestions for documentation (explain the word dequeRaymond Hettinger2004-02-071-0/+12
| | | | | comes from and show the differences from lists). * Add a rotate() method.