]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-36144: Add PEP 584 operators to collections.ChainMap (#18832)
authorCurtis Bucher <cpbucher5@gmail.com>
Mon, 23 Mar 2020 19:02:05 +0000 (12:02 -0700)
committerGitHub <noreply@github.com>
Mon, 23 Mar 2020 19:02:05 +0000 (12:02 -0700)
commitf393b2c588559162dc2e77f8079a42e48558870a
tree28bd1ee4ecf3104e76a7df28622aadc714400c6e
parent8ec7370c89aa522602eb9604086ce9f09770953d
bpo-36144: Add PEP 584 operators to collections.ChainMap (#18832)

* 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>
Doc/library/collections.rst
Lib/collections/__init__.py
Lib/test/test_collections.py
Misc/ACKS
Misc/NEWS.d/next/Library/2020-03-07-11-26-08.bpo-36144.FG9jqy.rst [new file with mode: 0644]