-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
bpo-45024 and bpo-23864: Document how interface testing works with the collections ABCs #28218
Conversation
Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Sorry @rhettinger, I had trouble checking out the |
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. |
…e collections ABCs (pythonGH-28218) (cherry picked from commit 62fa613) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
I think this resolves bpo 35190 as well. |
Maybe not - there's a comment at the end there to register array.array as a Sequence. |
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