summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_collections.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-98513: Test abstract methods of some `collections` types (#98516)Nikita Sobolev2022-11-081-0/+5
|
* gh-98512: Add more tests for `ValuesView` (#98515)Nikita Sobolev2022-11-031-0/+3
|
* GH-91079: Decouple C stack overflow checks from Python recursion checks. ↵Mark Shannon2022-10-051-1/+1
| | | | (GH-96510)
* bpo-39264: Fix UserDict.get() to account for __missing__() (GH-17910)Bar Harel2022-05-101-0/+8
| | | | | | Here's the patch according to the discussion at the [Python-Dev mailing list](https://mail.python.org/archives/list/python-dev@python.org/thread/SDXOEMAEM6KQ3CQCJVBVRT5QNSPAVU6X/). UserDict.get() will match dict's behavior and not call `__missing__`. Automerge-Triggered-By: GH:rhettinger
* gh-92107: Add tests that subscription works on arbitrary named tuple types ↵Serhiy Storchaka2022-05-041-0/+12
| | | | (GH-92304)
* bpo-46387: test all pickle protos in `test_field_descriptor` in ↵Nikita Sobolev2022-01-161-6/+8
| | | | `test_collections` (GH-30614)
* bpo-45859: Mark test_field_descriptor in test_collections as CPython-only ↵Carl Friedrich Bolz-Tereick2021-11-221-0/+1
| | | | (GH-29691)
* Fix typos in the Lib directory (GH-28775)Christian Clauss2021-10-061-1/+1
| | | | | Fix typos in the Lib directory as identified by codespell. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-45229: Use doctest.DocTestSuite instead of run_doctest (GH-28468)Serhiy Storchaka2021-09-201-13/+4
| | | Alo use load_tests() for adding tests.
* bpo-44704: Make Set._hash consistent with frozenset.__hash__ (GH-27281)Dennis Sweeney2021-07-211-0/+12
|
* bpo-25478: Add total() method to collections.Counter (GH-25829)Raymond Hettinger2021-05-031-0/+4
|
* bpo-43977: Make sure that tp_flags for pattern matching are inherited ↵Mark Shannon2021-05-021-0/+6
| | | | correctly. (GH-25813)
* bpo-43825: Fix deprecation warnings in test_cmd_line and test_collections ↵Karthikeyan Singaravelan2021-04-141-1/+1
| | | | | | (GH-25380) * Fix deprecation warnings due to invalid escape sequences. * Use self.assertEqual instead of deprecated self.assertEquals.
* Fix broken test for MutableSet.pop() (GH-25209)Stepan Sindelar2021-04-071-2/+6
| | | | Changes the test to not assert concrete result of pop, but just that it was an item from the set, and that the set shrunk by one.
* bpo-43245: Add keyword argument support to ChainMap.new_child() (GH-24788)Kamil Turek2021-03-141-0/+4
|
* bpo-42128: Structural Pattern Matching (PEP 634) (GH-22917)Brandt Bucher2021-02-261-0/+4
| | | | | Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Talin <viridia@gmail.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* bpo-42990: Add __builtins__ attribute to functions (GH-24559)Victor Stinner2021-02-181-3/+4
| | | | | | Expose the new PyFunctionObject.func_builtins member in Python as a new __builtins__ attribute on functions. Document also the behavior change in What's New in Python 3.10.
* bpo-43102: Set namedtuple __new__'s internal builtins to a dict. (GH-24439)Raymond Hettinger2021-02-041-0/+5
|
* bpo-42487: don't call __getitem__ of underlying maps in ChainMap.__iter__ ↵Andreas Poehlmann2020-11-301-0/+16
| | | | (GH-23534)
* Clarify that Set._from_iterable is not required to be a classmethod. (GH-23272)Richard Levasseur2020-11-211-0/+56
|
* bpo-40755: Add rich comparisons to Counter (GH-20548)Raymond Hettinger2020-05-311-66/+26
|
* bpo-40755: Add missing multiset operations to Counter() (GH-20339)Raymond Hettinger2020-05-281-0/+59
|
* bpo-40277: Add a repr() to namedtuple's _tuplegetter to aid with ↵Ammar Askar2020-04-151-0/+12
| | | | introspection (GH-19537)
* Fix bug in test_collections.py (#19221)Curtis Bucher2020-03-301-1/+2
| | | Test in TestChainMap() line 257 did not properly check union behavior.
* bpo-36144: Add PEP 584 operators to collections.ChainMap (#18832)Curtis Bucher2020-03-231-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update ChainMap to include | and |= Created __ior__, __or__ and __ror__ methods in ChainMap class. * Update ACKS * Update docs * Update test_collections.py to include test_issue584(). Added testing for | and |= operators for ChainMap objects. * Update test_union_operators Renamed test_union operators, fixed errors and style problems raised by brandtbucher. * Update test_union_operators in TestChainMap Added testing for union operator between ChainMap and iterable of key-value pairs. * Update test_union operators in test_collections.py Gave more descriptive variable names and eliminated unnecessary tmp variable. * Update test_union_operators in test_collections.py Added cm3 * Check .maps rather than Chainmap equality. * Add news entry * Update Lib/test/test_collections.py Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com> * Removed whitespace * Added Guido's changes * Fixed Docs * Removed whitespace Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* Add tests and design notes for Counter subset/superset operations. (GH-17625)Raymond Hettinger2019-12-161-0/+23
|
* Fix typos mostly in comments, docs and test names (GH-15209)Min ho Kim2019-08-301-1/+1
|
* bpo-37685: Use singletons ALWAYS_EQ and NEVER_EQ in more tests. (GH-15167)Serhiy Storchaka2019-08-081-4/+1
|
* Fix typos in comments, docs and test names (#15018)Min ho Kim2019-07-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | * Fix typos in comments, docs and test names * Update test_pyparse.py account for change in string length * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Apply suggestion: Dealloccte -> Deallocate Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Update posixmodule checksum. * Reverse idlelib changes.
* Remove unused imports in tests (GH-14518)Victor Stinner2019-07-011-1/+1
|
* bpo-27141: Fix collections.UserList and UserDict shallow copy. (GH-4094)Bar Harel2019-05-191-0/+24
|
* bpo-36321: Fix misspelled attribute in namedtuple() (GH-12375)Raymond Hettinger2019-03-181-6/+6
|
* bpo-36068: Make _tuplegetter objects serializable (GH-11981)Joe Jevnik2019-02-211-1/+10
|
* bpo-36057 Update docs and tests for ordering in collections.Counter [no ↵Raymond Hettinger2019-02-211-0/+57
| | | | | | | | | | behavior change] (#11962) * Add tests for Counter order. No behavior change. * Update docs and tests * Fix doctest output and capitalization
* bpo-36060: Document how collections.ChainMap() determines iteration order ↵Raymond Hettinger2019-02-211-0/+14
| | | | (GH-11969)
* bpo-32492: Tweak _collections._tuplegetter. (GH-11367)Serhiy Storchaka2018-12-311-18/+55
| | | | | | * Replace the docstrings cache with sys.intern(). * Improve tests. * Unify names of tp_descr_get and tp_descr_set functions.
* bpo-32492: 1.6x speed up in namedtuple attribute access using C fast-path ↵Pablo Galindo2018-12-301-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#10495) * bpo-32492: 2.5x speed up in namedtuple attribute access using C fast path * Add News entry * fixup! bpo-32492: 2.5x speed up in namedtuple attribute access using C fast path * Check for tuple in the __get__ of the new descriptor and don't cache the descriptor itself * Don't inherit from property. Implement GC methods to handle __doc__ * Add a test for the docstring substitution in descriptors * Update NEWS entry to reflect time against 3.7 branch * Simplify implementation with argument clinic, better error messages, only __new__ * Use positional-only parameters for the __new__ * Use PyTuple_GET_SIZE and PyTuple_GET_ITEM to tighter the implementation of tuplegetterdescr_get * Implement __set__ to make tuplegetter a data descriptor * Use Py_INCREF now that we inline PyTuple_GetItem * Apply the valid_index() function, saving one test * Move Py_None test out of the critical path.
* bpo-35202: Remove unused imports in Lib directory. (GH-10446)Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి)2018-11-101-2/+0
|
* bpo-33462: Add __reversed__ to dict and dict views (GH-6827)Rémi Lapeyre2018-11-061-13/+12
|
* bpo-34427: Fix infinite loop when calling MutableSequence.extend() on self ↵Naris R2018-08-301-0/+12
| | | | (GH-8813)
* bpo-32792: Preserve mapping order in ChainMap() (GH-5586)Raymond Hettinger2018-02-111-0/+17
|
* bpo-32467: Let collections.abc.ValuesView inherit from Collection (#5152)Raymond Hettinger2018-01-121-2/+2
|
* bpo-32320: Add default value support to collections.namedtuple() (#4859)Raymond Hettinger2018-01-111-0/+51
|
* bpo-32297: Few misspellings found in Python source code comments. (#4803)Mike2017-12-141-3/+3
| | | | | | | | * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py
* bpo-31709: Drop support for asynchronous __aiter__. (#3903)Yury Selivanov2017-10-061-2/+2
|
* bpo-28638: Optimize namedtuple() creation time by minimizing use of exec() ↵Raymond Hettinger2017-09-101-22/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#3454) * Working draft without _source * Re-use itemgetter() instances * Speed-up calls to __new__() with a pre-bound tuple.__new__() * Add note regarding string interning * Remove unnecessary create function wrappers * Minor sync-ups with PR-2736. Mostly formatting and f-strings * Bring-in qualname/__module fix-ups from PR-2736 * Formally remove the verbose flag and _source attribute * Restore a test of potentially problematic field names * Restore kwonly_args test but without the verbose option * Adopt Inada's idea to reuse the docstrings for the itemgetters * Neaten-up a bit * Add news blurb * Serhiy pointed-out the need for interning * Jelle noticed as missing f on an f-string * Add whatsnew entry for feature removal * Accede to request for dict literals instead keyword arguments * Leave the method.__module__ attribute pointing the actual location of the code * Improve variable names and add a micro-optimization for an non-public helper function * Simplify by in-lining reuse_itemgetter() * Arrange steps in more logical order * Save docstring in local cache instead of interning
* 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.
* bpo-26915: Test identity first in membership operation in index() and ↵Xiang Zhang2017-03-081-4/+13
| | | | | | count() methods of collections.abc.Sequence (GH-503)
* Issue #18896: Python function can now have more than 255 parameters.Serhiy Storchaka2016-12-161-2/+1
| | | | collections.namedtuple() now supports tuples with more than 255 elements.
* Issue #28720: Add collections.abc.AsyncGenerator.Yury Selivanov2016-11-161-1/+83
|