summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_deque.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-39590: make deque.__contains__ and deque.count hold strong references ↵Miss Islington (bot)2020-02-091-0/+12
| | | | | | | | | | (GH-18421) (GH-18423) (cherry picked from commit c6dedde160a9fce5d049e860f586ad8f93aec822) Co-authored-by: sweeneyde <36520290+sweeneyde@users.noreply.github.com> Co-authored-by: sweeneyde <36520290+sweeneyde@users.noreply.github.com>
* Minor performance tweak for deque.index() with a start argument (GH-9440)Raymond Hettinger2018-09-211-0/+8
|
* closes bpo-31608: Fix a crash in methods of a subclass of _collections.deque ↵Oren Milman2018-09-111-0/+15
| | | | with a bad __new__(). (GH-3788)
* bpo-29919: Remove unused imports found by pyflakes (#137)Victor Stinner2017-03-271-1/+0
| | | Make also minor PEP8 coding style fixes on modified imports.
* 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ä.
* | Fixed test_sizeof for deque.Serhiy Storchaka2016-05-181-2/+2
|\ \ | |/
| * 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 str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
| * Issue #26494: Fixed crash on iterating exhausting iterators.Serhiy Storchaka2016-03-301-0/+4
| | | | | | | | | | | | Affected classes are generic sequence iterators, iterators of str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
* | Issue #26015: Added new tests for pickling iterators of mutable sequences.Serhiy Storchaka2016-03-061-11/+38
|\ \ | |/
| * Issue #26015: Added new tests for pickling iterators of mutable sequences.Serhiy Storchaka2016-03-061-11/+38
| |
| * Issue #26194: Inserting into a full deque to raise an IndexErrorRaymond Hettinger2016-02-021-11/+12
| |
* | Issue #26482: Allowed pickling recursive dequeues.Serhiy Storchaka2016-03-061-32/+36
| |
* | mergeRaymond Hettinger2016-02-021-11/+12
| |
* | mergeRaymond Hettinger2016-01-271-0/+14
|\ \ | |/
| * Issue #26194: Fix undefined behavior for deque.insert() when len(d) == maxlenRaymond Hettinger2016-01-271-0/+14
| |
| * Issue #24913: Fix overrun error in deque.index().Brett Cannon2015-09-031-0/+5
| | | | | | | | Reported by John Leitch and Bryce Darling, patch by Raymond Hettinger.
* | Fix typoRaymond Hettinger2016-01-261-1/+1
| |
* | Add a fast path (no iterator creation) for a common case for repeating ↵Raymond Hettinger2015-09-191-0/+9
| | | | | | | | deques of size 1
* | Issue #24913: Fix overrun error in deque.index().Raymond Hettinger2015-08-261-0/+5
|/
* Check deques against common sequence tests (except for slicing).Raymond Hettinger2015-04-011-0/+16
|
* Issue 23793: Add deque support for __add__(), __mul__(), and __imul__().Raymond Hettinger2015-03-311-0/+77
|
* Issue 23704: Add index(), copy(), and insert() to deques. Register deques ↵Raymond Hettinger2015-03-211-0/+57
| | | | as a MutableSequence.
* Issue 23705: Improve the performance of __contains__ checks for deques.Raymond Hettinger2015-03-201-0/+20
|
* Bump the blocksize up from 62 to 64 to speed up the modulo calculation.Raymond Hettinger2015-02-271-1/+1
| | | | | | | | | Remove the old comment suggesting that it was desireable to have blocksize+2 as a multiple of the cache line length. That would have made sense only if the block structure start point was always aligned to a cache line boundary. However, the memory allocations are 16 byte aligned, so we don't really have control over whether the struct spills across cache line boundaries.
* Issue #22777: Test pickling with all protocols.Serhiy Storchaka2014-12-151-20/+23
|\
| * Issue #22777: Test pickling with all protocols.Serhiy Storchaka2014-12-151-20/+23
| |
* | Issue 19898: Add test for dequereviter_new.Raymond Hettinger2014-06-151-0/+5
|/ | | | (Patch contributed by Claudiu Popa.)
* 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".
* Add a spacing saving heuristic to deque's extend methodsRaymond Hettinger2013-07-091-2/+2
|
* Speed-up deque indexing by changing the deque block length to a power of two.Raymond Hettinger2013-07-061-1/+1
| | | | | | | | | | | | | | | The division and modulo calculation in deque_item() can be compiled to fast bitwise operations when the BLOCKLEN is a power of two. Timing before: ~/cpython $ py -m timeit -r7 -s 'from collections import deque' -s 'd=deque(range(10))' 'd[5]' 10000000 loops, best of 7: 0.0627 usec per loop Timing after: ~/cpython $ py -m timeit -r7 -s 'from collections import deque' -s 'd=deque(range(10))' 'd[5]' 10000000 loops, best of 7: 0.0581 usec per loop
* MERGE: Closes #15469: Correct __sizeof__ support for dequeJesus Cea2012-08-031-0/+16
|\
| * Closes #15469: Correct __sizeof__ support for dequeJesus Cea2012-08-031-0/+16
| |
* | Issue #14288: Serialization support for builtin iterators.Kristján Valur Jónsson2012-04-031-0/+13
|/
* Issue #11004: Repair edge case in deque.count().Raymond Hettinger2011-01-251-0/+9
| | | | | | | | | (Reviewed by Georg Brandl.) Also made similar changes to deque.reverse() though this wasn't strictly necessary (the edge case cannot occur with two pointers moving to meet in the middle). Making the change in reverse() was more a matter of future-proofing.
* #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-1/+1
|
* Add count() method to collections.deque().Raymond Hettinger2010-04-031-0/+24
|
* Merged revisions 78093 via svnmerge fromGeorg Brandl2010-03-141-1/+0
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78093 | georg.brandl | 2010-02-07 18:03:15 +0100 (So, 07 Feb 2010) | 1 line Remove unused imports in test modules. ........
* use assert[Not]In where appropriateBenjamin Peterson2010-01-191-3/+3
| | | | A patch from Dave Malcolm.
* Fix variants of deque.extend: d.extend(d) d+=d d.extendleft(d)Raymond Hettinger2009-12-101-0/+11
|
* Add a reverse() method to collections.deque().Raymond Hettinger2009-12-101-0/+12
|
* convert old fail* assertions 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
|
* Issue #1717: Remove cmp. Stage 1: remove all uses of cmp and __cmp__ fromMark Dickinson2009-01-271-1/+0
| | | | the standard library and tests.
* Merged revisions 68128 via svnmerge fromAntoine Pitrou2009-01-011-2/+19
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r68128 | antoine.pitrou | 2009-01-01 15:11:22 +0100 (jeu., 01 janv. 2009) | 3 lines Issue #3680: Reference cycles created through a dict, set or deque iterator did not get collected. ........
* Issue #4740: Use HIGHEST_PROTOCOL in pickle test. This enables test for ↵Hirokazu Yamamoto2008-12-271-2/+2
| | | | | | protocol 3 (== HIGHEST_PROTOCOL in 3.x)
* #2621 rename test.test_support to test.supportBenjamin Peterson2008-05-201-15/+15
|
* Merged revisions ↵Christian Heimes2008-04-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 62260-62261,62266,62271,62277-62279,62289-62290,62293-62298,62302-62306,62308,62311,62313-62315,62319-62321 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r62260 | gregory.p.smith | 2008-04-10 01:11:56 +0200 (Thu, 10 Apr 2008) | 2 lines better diagnostics ........ r62261 | gregory.p.smith | 2008-04-10 01:16:37 +0200 (Thu, 10 Apr 2008) | 3 lines Raise SystemError when size < 0 is passed into PyString_FromStringAndSize, PyBytes_FromStringAndSize or PyUnicode_FromStringAndSize. [issue2587] ........ r62266 | neal.norwitz | 2008-04-10 07:46:39 +0200 (Thu, 10 Apr 2008) | 5 lines Remove the test file before writing it in case there is no write permission. 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). ........ r62271 | gregory.p.smith | 2008-04-10 21:50:36 +0200 (Thu, 10 Apr 2008) | 2 lines get rid of assert (size >= 0) now that an explicit if (size < 0) is in the code. ........ r62277 | andrew.kuchling | 2008-04-10 23:27:10 +0200 (Thu, 10 Apr 2008) | 1 line Remove forward-looking statement ........ r62278 | andrew.kuchling | 2008-04-10 23:28:51 +0200 (Thu, 10 Apr 2008) | 1 line Add punctuation ........ r62279 | andrew.kuchling | 2008-04-10 23:29:01 +0200 (Thu, 10 Apr 2008) | 1 line Use issue directive ........ r62289 | thomas.heller | 2008-04-11 15:05:38 +0200 (Fri, 11 Apr 2008) | 3 lines Move backwards compatibility macro to the correct place; PyIndex_Check() was introduced in Python 2.5. ........ r62290 | thomas.heller | 2008-04-11 16:20:26 +0200 (Fri, 11 Apr 2008) | 2 lines Performance improvements. ........ r62293 | christian.heimes | 2008-04-12 15:03:03 +0200 (Sat, 12 Apr 2008) | 2 lines Applied patch #2617 from Frank Wierzbicki wit some extras from me -J and -X are now reserved for Jython and non-standard arguments (e.g. IronPython). I've added some extra comments to make sure the reservation don't get missed in the future. ........ r62294 | georg.brandl | 2008-04-12 20:11:18 +0200 (Sat, 12 Apr 2008) | 2 lines Use absolute path in sys.path. ........ r62295 | georg.brandl | 2008-04-12 20:36:09 +0200 (Sat, 12 Apr 2008) | 2 lines #2615: small consistency update by Jeroen Ruigrok van der Werven. ........ r62296 | georg.brandl | 2008-04-12 21:00:20 +0200 (Sat, 12 Apr 2008) | 2 lines Add Jeroen. ........ r62297 | georg.brandl | 2008-04-12 21:05:37 +0200 (Sat, 12 Apr 2008) | 2 lines Don't offend snake lovers. ........ r62298 | gregory.p.smith | 2008-04-12 22:37:48 +0200 (Sat, 12 Apr 2008) | 2 lines fix compiler warnings ........ r62302 | gregory.p.smith | 2008-04-13 00:24:04 +0200 (Sun, 13 Apr 2008) | 3 lines socket.error inherits from IOError, it no longer needs listing in the all_errors tuple. ........ r62303 | brett.cannon | 2008-04-13 01:44:07 +0200 (Sun, 13 Apr 2008) | 8 lines Re-implement the 'warnings' module in C. This allows for usage of the 'warnings' code in places where it was previously not possible (e.g., the parser). It could also potentially lead to a speed-up in interpreter start-up if the C version of the code (_warnings) is imported over the use of the Python version in key places. Closes issue #1631171. ........ r62304 | gregory.p.smith | 2008-04-13 02:03:25 +0200 (Sun, 13 Apr 2008) | 3 lines Adds a profile-opt target for easy compilation of a python binary using gcc's profile guided optimization. ........ r62305 | brett.cannon | 2008-04-13 02:18:44 +0200 (Sun, 13 Apr 2008) | 3 lines Fix a bug in PySys_HasWarnOption() where it was not properly checking the length of the list storing the warning options. ........ r62306 | brett.cannon | 2008-04-13 02:25:15 +0200 (Sun, 13 Apr 2008) | 2 lines Fix an accidental bug of an non-existent init function. ........ r62308 | andrew.kuchling | 2008-04-13 03:05:59 +0200 (Sun, 13 Apr 2008) | 1 line Mention -J, -X ........ r62311 | benjamin.peterson | 2008-04-13 04:20:05 +0200 (Sun, 13 Apr 2008) | 2 lines Give the "Interactive Interpreter Changes" section in 2.6 whatsnew a unique link name ........ r62313 | brett.cannon | 2008-04-13 04:42:36 +0200 (Sun, 13 Apr 2008) | 3 lines Fix test_warnings by making the state of things more consistent for each test when it is run. ........ r62314 | skip.montanaro | 2008-04-13 05:17:30 +0200 (Sun, 13 Apr 2008) | 2 lines spelling ........ r62315 | georg.brandl | 2008-04-13 09:07:44 +0200 (Sun, 13 Apr 2008) | 2 lines Fix markup. ........ r62319 | christian.heimes | 2008-04-13 11:30:17 +0200 (Sun, 13 Apr 2008) | 1 line Fix compiler warning Include/warnings.h:19:28: warning: no newline at end of file ........ r62320 | christian.heimes | 2008-04-13 11:33:24 +0200 (Sun, 13 Apr 2008) | 1 line Use PyString_InternFromString instead of PyString_FromString for static vars ........ r62321 | christian.heimes | 2008-04-13 11:37:05 +0200 (Sun, 13 Apr 2008) | 1 line Added new files to the pcbuild files ........