feat: support for partialmethod - #665
Conversation
mauvilsa
left a comment
There was a problem hiding this comment.
I can't think of a reason why not to support this. Please go ahead and write the unit tests.
I was able to add support for The options would be to add a subsection in |
mauvilsa
left a comment
There was a problem hiding this comment.
I was able to add support for partialmethod and added a test for it. For partial functions and classes it's a bit trickier since they are dynamic and it seems the parameter resolver is expecting static objects for the most part.
What was the reason you came to know that partials didn't work? I would guess it was because you needed it for some use case. If it was only for partialmethod, then what is implemented now already works and is a new feature. If you really want partial to also work, later I can take a look.
For classes the main reason is that For reference, my use case was to create partial classes. I got around the limitations by using |
|
For partial functions and classes being dynamic, the import path would also be a problem. If a partial function is saved at the top level of a module in a variable, from the partial function object alone can it be determined what its import path should be? |
|
I updated the branch because the checks were not working correctly. |
5571ffb to
0cc81a1
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #665 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 27
Lines 8734 8777 +43
=========================================
+ Hits 8734 8777 +43 ☔ View full report in Codecov by Harness. |
What does this PR do?
Adds support for functools.partial and functools.partialmethod and closes #664
Still need to write tests and update documentation but would like wait for @mauvilsa to weigh in to see if the idea makes sense.
Before submitting