summaryrefslogtreecommitdiff
path: root/Lib/test/test_dict.py
Commit message (Collapse)AuthorAgeFilesLines
* Test dict values iterator pickling with pickle.HIGHEST_PROTOCOL. (GH-9052)Miss Islington (bot)2018-09-101-1/+1
| | | | | (cherry picked from commit 1f36bf6077d93cb43fd84bea4a8a625fa772d1fa) Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
* bpo-31179: Make dict.copy() up to 5.5 times faster. (#3067)Yury Selivanov2018-01-221-2/+48
|
* bpo-32137: The repr of deeply nested dict now raises a RecursionError (#4570)Serhiy Storchaka2017-12-031-0/+6
| | | | | instead of crashing due to a stack overflow. This perhaps will fix similar problems in other extension types.
* bpo-27945: Fixed various segfaults with dict. (#1657)Serhiy Storchaka2017-05-201-0/+85
| | | | Based on patches by Duane Griffin and Tim Mitchell.
* Fix a memory leak in split-table dictionariesVictor Stinner2016-12-151-0/+30
| | | | | | | Issue #28147: Fix a memory leak in split-table dictionaries: setattr() must not convert combined table into split table. Patch written by INADA Naoki.
* Issue #28123: _PyDict_GetItem_KnownHash() now can raise an exception asSerhiy Storchaka2016-11-061-0/+31
| | | | PyDict_GetItemWithError(). Patch by Xiang Zhang.
* Issue #28583: PyDict_SetDefault didn't combine split table when needed.INADA Naoki2016-11-021-0/+17
| | | | Patch by Xiang Zhang.
* Fix _PyDict_Pop() on pending keyVictor Stinner2016-09-131-0/+9
| | | | | | | Issue #28120: Fix dict.pop() for splitted dictionary when trying to remove a "pending key" (Not yet inserted in split-table). Patch by Xiang Zhang.
* Fix SystemError in compact dictVictor Stinner2016-09-091-0/+69
| | | | | | | | | Issue #28040: Fix _PyDict_DelItem_KnownHash() and _PyDict_Pop(): convert splitted table to combined table to be able to delete the item. Write an unit test for the issue. Patch by INADA Naoki.
* Issue #27125: Merge typo fixes from 3.5Martin Panter2016-05-301-1/+1
|\
| * Issue #27125: Remove duplicated words from documentation and commentsMartin Panter2016-05-301-1/+1
| |
* | Issue #26494: Fixed crash on iterating exhausting iterators.Serhiy Storchaka2016-03-301-0/+6
|\ \ | |/ | | | | | | | | 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/+6
| | | | | | | | | | | | Affected classes are generic sequence iterators, iterators of str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
* | Cleanup test_dictVictor Stinner2016-01-231-5/+8
|/ | | | | | * Write one import per line * Sort imports by name * Add an empty line: 2 empty lines between code blocks at the module level (PEP 8)
* Issue #25523: Merge a-to-an corrections from 3.4.Serhiy Storchaka2015-11-021-1/+1
|\
| * Issue #25523: Further a-to-an corrections.Serhiy Storchaka2015-11-021-1/+1
| |
* | merge 3.4 (#24407)Benjamin Peterson2015-07-041-0/+14
|\ \ | |/
| * merge 3.3 (#24407)Benjamin Peterson2015-07-041-0/+14
| |\
| | * protect against mutation of the dict during insertion (closes #24407)Benjamin Peterson2015-07-041-0/+15
| | |
* | | Issue #21741: Update 147 test modules to use test discovery.Zachary Ware2015-04-131-8/+1
|/ / | | | | | | | | | | | | I have compared output between pre- and post-patch runs of these tests to make sure there's nothing missing and nothing broken, on both Windows and Linux. The only differences I found were actually tests that were previously *not* run.
* | Issue #22777: Test pickling with all protocols.Serhiy Storchaka2014-12-151-47/+50
| |
* | Issue #22653: Fix an assertion failure in debug mode when doing a reentrant ↵Antoine Pitrou2014-10-181-0/+29
|/ | | | dict insertion in debug mode.
* #19166: use an unused var in a test. Patch by Vajrasky Kok.Ezio Melotti2013-10-051-0/+3
|
* merge 3.2 (#16345)Benjamin Peterson2012-10-311-0/+8
|\
| * only fast-path fromkeys() when the constructor returns a empty dict (closes ↵Benjamin Peterson2012-10-311-0/+8
| | | | | | | | #16345)
* | Issue #14417: Mutating a dict during lookup now restarts the lookup instead ↵Antoine Pitrou2012-05-131-4/+3
| | | | | | | | of raising a RuntimeError (undoes issue #14205).
* | distiguish between refusing to creating shared keys and error (#13903)Benjamin Peterson2012-04-241-0/+7
| |
* | fix instance dicts with str subclasses (#13903)Benjamin Peterson2012-04-231-0/+10
| |
* | Implement PEP 412: Key-sharing dictionaries (closes #13903)Benjamin Peterson2012-04-231-0/+21
| | | | | | | | Patch from Mark Shannon.
* | Issue #14288: Serialization support for builtin iterators.Kristján Valur Jónsson2012-04-031-0/+54
| |
* | Issue #14205: Fix test_dict.test_mutating_lookup()Victor Stinner2012-03-091-9/+16
| |
* | Close #14205: dict lookup raises a RuntimeError if the dict is modified duringVictor Stinner2012-03-061-1/+21
|/ | | | | | | a lookup. "if you want to make a sandbox on top of CPython, you have to fix segfaults" so let's fix segfaults!
* Issue #13521: dict.setdefault() now does only one lookup for the given key, ↵Antoine Pitrou2012-02-271-0/+20
| | | | | | making it "atomic" for many purposes. Patch by Filip Gruszczyński.
* handle dict subclasses gracefully in PyArg_ValidateKeywordArgumentsBenjamin Peterson2010-11-171-4/+7
|
* Reverted inadvertent change from r86095Alexander Belopolsky2010-11-011-8/+0
|
* Issue #10199: Moved Demo/turtle under Lib/Alexander Belopolsky2010-11-011-0/+8
|
* Merged revisions 81465-81466,81468,81679,81735,81760,81868,82183 via ↵Benjamin Peterson2010-06-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81465 | georg.brandl | 2010-05-22 06:29:19 -0500 (Sat, 22 May 2010) | 2 lines Issue #3924: Ignore cookies with invalid "version" field in cookielib. ........ r81466 | georg.brandl | 2010-05-22 06:31:16 -0500 (Sat, 22 May 2010) | 1 line Underscore the name of an internal utility function. ........ r81468 | georg.brandl | 2010-05-22 06:43:25 -0500 (Sat, 22 May 2010) | 1 line #8635: document enumerate() start parameter in docstring. ........ r81679 | benjamin.peterson | 2010-06-03 16:21:03 -0500 (Thu, 03 Jun 2010) | 1 line use a set for membership testing ........ r81735 | michael.foord | 2010-06-05 06:46:59 -0500 (Sat, 05 Jun 2010) | 1 line Extract error message truncating into a method (unittest.TestCase._truncateMessage). ........ r81760 | michael.foord | 2010-06-05 14:38:42 -0500 (Sat, 05 Jun 2010) | 1 line Issue 8302. SkipTest exception is setUpClass or setUpModule is now reported as a skip rather than an error. ........ r81868 | benjamin.peterson | 2010-06-09 14:45:04 -0500 (Wed, 09 Jun 2010) | 1 line fix code formatting ........ r82183 | benjamin.peterson | 2010-06-23 15:29:26 -0500 (Wed, 23 Jun 2010) | 1 line cpython only gc tests ........
* prevent the dict constructor from accepting non-string keyword args #8419Benjamin Peterson2010-04-241-0/+6
| | | | | This adds PyArg_ValidateKeywordArguments, which checks that keyword arguments are all strings, using an optimized method if possible.
* Recorded merge of revisions 78582 via svnmerge fromFlorent Xicluna2010-03-021-92/+79
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78582 | florent.xicluna | 2010-03-02 17:00:00 +0100 (mar, 02 mar 2010) | 2 lines Refactor test_dict using assertRaises. ........
* Merged revisions 77727 via svnmerge fromEzio Melotti2010-01-241-1/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77727 | ezio.melotti | 2010-01-24 18:58:36 +0200 (Sun, 24 Jan 2010) | 1 line use assert[Not]IsInstance where appropriate ........
* use assert[Not]In where appropriateEzio Melotti2010-01-231-8/+1
|
* use assert[Not]In where appropriateBenjamin Peterson2010-01-191-0/+8
| | | | A patch from Dave Malcolm.
* Issue #7435: Remove duplicate int/long tests, and otherMark Dickinson2009-12-051-7/+0
| | | | references to long in py3k. Patch provided by flox.
* convert old fail* assertions to assert*Benjamin Peterson2009-06-301-26/+26
|
* Merged revisions 70546 via svnmerge fromAntoine Pitrou2009-03-231-0/+98
| | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r70546 | antoine.pitrou | 2009-03-23 19:41:45 +0100 (lun., 23 mars 2009) | 9 lines Issue #4688: Add a heuristic so that tuples and dicts containing only untrackable objects are not tracked by the garbage collector. This can reduce the size of collections and therefore the garbage collection overhead on long-running programs, depending on their particular use of datatypes. (trivia: this makes the "binary_trees" benchmark from the Computer Language Shootout 40% faster) ........
* Give dict views a helpful __repr__.Raymond Hettinger2009-03-031-3/+3
|
* Issue #1717: Remove cmp. Stage 1: remove all uses of cmp and __cmp__ fromMark Dickinson2009-01-271-1/+1
| | | | the standard library and tests.
* Merged revisions 68128 via svnmerge fromAntoine Pitrou2009-01-011-0/+16
| | | | | | | | | | 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. ........
* Merged revisions ↵Georg Brandl2008-08-121-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 65459,65472,65481,65518,65536,65581,65609,65637,65641,65644-65645 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r65459 | gregory.p.smith | 2008-08-04 00:13:29 +0000 (Mon, 04 Aug 2008) | 4 lines - Issue #1857: subprocess.Popen.poll gained an additional _deadstate keyword argument in python 2.5, this broke code that subclassed Popen to include its own poll method. Fixed my moving _deadstate to an _internal_poll method. ........ r65472 | andrew.kuchling | 2008-08-04 01:43:43 +0000 (Mon, 04 Aug 2008) | 3 lines Bug 3228: Explicitly supply the file mode to avoid creating executable files, and add corresponding tests. Possible 2.5 backport candidate ........ r65481 | gregory.p.smith | 2008-08-04 07:33:37 +0000 (Mon, 04 Aug 2008) | 22 lines Adds a sanity check to avoid a *very rare* infinite loop due to a corrupt tls key list data structure in the thread startup path. This change is a companion to r60148 which already successfully dealt with a similar issue on thread shutdown. In particular this loop has been observed happening from this call path: #0 in find_key () #1 in PyThread_set_key_value () #2 in _PyGILState_NoteThreadState () #3 in PyThreadState_New () #4 in t_bootstrap () #5 in pthread_start_thread () I don't know how this happens but it does, *very* rarely. On more than one hardware platform. I have not been able to reproduce it manually. (A flaky mutex implementation on the system in question is one hypothesis). As with r60148, the spinning we managed to observe in the wild was due to a single list element pointing back upon itself. ........ r65518 | mark.dickinson | 2008-08-04 21:30:09 +0000 (Mon, 04 Aug 2008) | 7 lines Issue #1481296: (again!) Make conversion of a float NaN to an int or long raise ValueError instead of returning 0. Also, change the error message for conversion of an infinity to an integer, replacing 'long' by 'integer', so that it's appropriate for both long(float('inf')) and int(float('inf')). ........ r65536 | andrew.kuchling | 2008-08-05 01:00:57 +0000 (Tue, 05 Aug 2008) | 1 line Bug 3228: take a test from Niels Gustaebel's patch, and based on his patch, check for having os.stat available ........ r65581 | guido.van.rossum | 2008-08-07 18:51:38 +0000 (Thu, 07 Aug 2008) | 3 lines Patch by Ian Charnas from issue 3517. Add F_FULLFSYNC if it exists (OS X only so far). ........ r65609 | antoine.pitrou | 2008-08-09 17:22:25 +0000 (Sat, 09 Aug 2008) | 3 lines #3205: bz2 iterator fails silently on MemoryError ........ r65637 | georg.brandl | 2008-08-11 09:07:59 +0000 (Mon, 11 Aug 2008) | 3 lines - Issue #3537: Fix an assertion failure when an empty but presized dict object was stored in the freelist. ........ r65641 | jesse.noller | 2008-08-11 14:28:07 +0000 (Mon, 11 Aug 2008) | 2 lines Remove the fqdn call for issue 3270 ........ r65644 | antoine.pitrou | 2008-08-11 17:21:36 +0000 (Mon, 11 Aug 2008) | 3 lines #3134: shutil referenced undefined WindowsError symbol ........ r65645 | jesse.noller | 2008-08-11 19:00:15 +0000 (Mon, 11 Aug 2008) | 2 lines Fix the connection refused error part of issue 3419, use errno module instead of a static list of possible connection refused messages. ........
* #2621 rename test.test_support to test.supportBenjamin Peterson2008-05-201-2/+2
|