rope
rope copied to clipboard
Document IntroduceParameter refactoring
I'd like to be able to do the following refactoring:
# before
def foo():
bar(some_expr)
# after
def foo(new_param=some_expr):
bar(new_param)
Could this be added to rope?
Additional acceptance criteria:
- [ ] Update documentation
That's an interesting idea. I think there is some complexity in it, for example if the expression being moved references variables defined in the function scope.
If you would like to add this capability, we would gratefully accept a pull request.
It seems to me a bit dangerous: mutable default arguments are evil, so the code would have to check that it doesn’t do The Bad Thing™.
This seems to have already been supported by the IntroduceParameter refactoring.
It is currently undocumented and I don't think currently there are any editor integration currently that implements them though.