rope.refactor.introduce_parameter ================================= .. py:module:: rope.refactor.introduce_parameter Classes ------- .. autoapisummary:: rope.refactor.introduce_parameter.IntroduceParameter Module Contents --------------- .. py:class:: IntroduceParameter(project, resource, offset) Introduce parameter refactoring This refactoring adds a new parameter to a function and replaces references to an expression in it with the new parameter. The parameter finding part is different from finding similar pieces in extract refactorings. In this refactoring parameters are found based on the object they reference to. For instance in:: class A(object): var = None class B(object): a = A() b = B() a = b.a def f(a): x = b.a.var + a.var using this refactoring on ``a.var`` with ``p`` as the new parameter name, will result in:: def f(p=a.var): x = p + p .. py:attribute:: project .. py:attribute:: resource .. py:attribute:: offset .. py:attribute:: pymodule .. py:attribute:: pyfunction .. py:method:: get_changes(new_parameter)