-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Fix/callable protocols 2 #599
Fix/callable protocols 2 #599
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #599 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 6491 6493 +2
=========================================
+ Hits 6491 6493 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a unit test for a protocol with __call__
.
I added some tests for callable protocols. One question that came up is whether functions should be checked against the protocol. Currently that test is failing, here is the example:
The result is:
|
Thanks for the feedback, sorry it's been really busy at work, I will try to get to this next week |
I made the necessary fixes, currently only one subtest is failing but I don't fully understand why.
The last subtest
It does not happen in the normal (not callable) protocol tests. |
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. But please remove the TODOs as commented.
all should be good now |
What does this PR do?
Fixes callable protocol inheritance by allowing a list of private methods to be considered when matching signatures for inheritance of subclasses. The set of
allowed_dunder_methods
currently only contains the__call__
method.Fixes #595
Before submitting