{{ message }}
gh-74690: Document changes made to runtime-checkable protocols in 3.12#103348
Merged
AlexWaygood merged 8 commits intopython:mainfrom Apr 7, 2023
Merged
Conversation
carljm
approved these changes
Apr 7, 2023
CAM-Gerlach
reviewed
Apr 7, 2023
JelleZijlstra
approved these changes
Apr 7, 2023
hauntsaninja
approved these changes
Apr 7, 2023
Contributor
There was a problem hiding this comment.
The changes look good. Only thing I'm thinking of is that most users reading What's New still don't have the context that runtime_checkable isinstance is like 400x slower than regular isinstance or whatever. Feels hard to communicate "this thing is 20x faster than it was, but is still 20x slower than you might think it is", but maybe there's a good way :-)
Member
Author
warsaw
pushed a commit
to warsaw/cpython
that referenced
this pull request
Apr 11, 2023
…in 3.12 (python#103348) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
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.

Adds docs, NEWS and WhatsNew entries for changes made in these PRs:
_get_protocol_attrstwice in_ProtocolMeta.__instancecheck__#103141typing._get_protocol_attrs#103152_ProtocolMeta.__instancecheck__#103159_get_protocol_attrsand_callable_members_onlyat protocol class creation time, not duringisinstance()checks #103160typing._ProtocolMeta.__instancecheck__#103280inspect.getattr_static#103195inspect.getattr_static#103318inspect._is_type#103321