bpo-45024 and bpo-23864: Document how interface testing works with the collections ABCs#28218
Merged
Conversation
Contributor
|
Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Contributor
|
Sorry @rhettinger, I had trouble checking out the |
Contributor
|
Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
|
GH-28266 is a backport of this pull request to the 3.10 branch. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Sep 10, 2021
…e collections ABCs (pythonGH-28218) (cherry picked from commit 62fa613) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
rhettinger
pushed a commit
that referenced
this pull request
Sep 10, 2021
Member
|
I think this resolves bpo 35190 as well. |
Member
Maybe not - there's a comment at the end there to register array.array as a Sequence. |
pablogsal
pushed a commit
that referenced
this pull request
Sep 29, 2021
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
To resolve long standing confusion, I've enumerated the three principal ways to test interfaces using the collections ABCs. For each, there are provided examples and explanation. Also added footnotes to the ABC table to indicate which ABCs can use hasattr() logic rather than direct subclassing or registration.
https://bugs.python.org/issue45024