-
Notifications
You must be signed in to change notification settings - Fork 941
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Renaming parameters of functions/classes is super useful and is - in my opinion - well implemented. The python extension automatically looks for all the places in the code where the function/class is called and applies the renaming accordingly.
However, the extension does not recognize calls that are made with functools.partial. As a consequence, when running the code, we get "TypeError: unexpected keyword argument".
Minimal example below:
Before:
from functools import partial
def foo(a: int, b: str):
print(a, b)
def main():
foo(a=1, b="hello")
partial_foo = partial(foo, a=1)
partial_foo(b="world")
if __name__ == "__main__":
main()After:
from functools import partial
def foo(number: int, b: str):
print(number, b)
def main():
foo(number=1, b="hello")
partial_foo = partial(foo, a=1) # <- Problem here!
partial_foo(b="world")
if __name__ == "__main__":
main()The renaming feature is great, but it needs to work in 100% of the cases, otherwise I'm gonna be afraid of using it.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
