-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
__match_args__
+ runtime_checkable
protocol
#110682
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
Labels
Comments
Related #110686 |
I agree that |
JelleZijlstra
pushed a commit
that referenced
this issue
Oct 12, 2023
…ols (#110683) Co-authored-by: Alex Waygood <[email protected]>
Sounds like the consensus is that this was really a "missing feature" rather than a bug, so we won't be backporting this |
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this issue
Sep 2, 2024
…protocols (python#110683) Co-authored-by: Alex Waygood <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Since
__match_args__
is not mentioned in_SPECIAL_NAMES
right now these two examples have different results:And:
Why I think that
__match_args__
is a special attribute and should not be checked inisinstance
?But, this does not work right now if
A
does not have__match_args__
. Which is not really required for this case.__slots__
and__weakref__
and__annotations__
are ignored alreadyDo others agree?
CC @AlexWaygood for
@runtime_checkable
protocolsI will send a PR with my proposed solution and tests :)
Linked PRs
__match_args__
from__instancecheck__
in protocols #110683The text was updated successfully, but these errors were encountered: