-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-36144: Dictionary Union (PEP 584) #12088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+107
−18
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
9397506
Create dict_add and dict__iadd dict methods.
brandtbucher c69108a
Fix failing "sum" test.
brandtbucher dd42f4f
Update collections.UserDict.
brandtbucher f59cdab
Update test_dict.py.
brandtbucher d895b9b
Update ACKS.
brandtbucher da8e2e3
Fixed whitespace.
brandtbucher 91d6466
Update doctest count for builtins.
brandtbucher b2eced1
📜🤖 Added by blurb_it.
blurb-it[bot] bf0b383
Fix error handling.
brandtbucher e660046
Be "nicer" to subclasses than other built-in types.
brandtbucher 4c0223b
Add dict subtraction operations.
brandtbucher 2cb1629
Add new subtraction methods to collections.UserDict.
brandtbucher 05ed4cf
Add new dict subtraction tests.
brandtbucher 594ae27
📜🤖 Added by blurb_it.
blurb-it[bot] d1c830c
Merge branch 'addiction' of https://github.com/brandtbucher/cpython i…
brandtbucher f7ed0a2
Better error handling and "keys" method lookup.
brandtbucher 8be454a
Clean up comments, names, and logic.
brandtbucher 63c36dd
Update commented code.
brandtbucher 2ba0580
Update new collections.UserDict operators.
brandtbucher fa44826
Add | and |= operators as aliases to + and +=.
brandtbucher 5d77bf8
Fix whitespace... again.
brandtbucher 1793169
Catch up with master.
brandtbucher 362657e
Remove sub/isub/or/ior operators.
brandtbucher 04fb96e
Remove extra whitespace.
brandtbucher 567a218
Use copy() instead of __new__() and update(self).
brandtbucher 159ebda
Clarify NEWS entry.
brandtbucher 28c5c56
+ -> |
brandtbucher 6951380
Update UserDict.
brandtbucher 514e1ee
Catch up with master.
brandtbucher 3567247
Modernize UserDict.__or__ trio.
brandtbucher 4588b56
Rename test.
brandtbucher 977ffcd
Feedback from code review.
brandtbucher a26a98e
Actually call the "copy" and "update" methods of subclasses.
brandtbucher dfa7009
Consolidate shared logic.
brandtbucher 7c40ba6
Check the return type of self.copy().
brandtbucher b977a27
Add tests for subclasses.
brandtbucher f09ba7a
Strip whitespace.
brandtbucher ec33664
Remove calls to "update" method when merging.
brandtbucher 4afd3b6
Revert subclass-preserving stuff.
brandtbucher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/Core and Builtins/2019-03-02-23-03-34.bpo-36144.LRl4LS.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
:class:`dict` (and :class:`collections.UserDict`) objects now support PEP 584's merge (``|``) and update (``|=``) operators. | ||
Patch by Brandt Bucher. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.