Skip to content

add class hierarchy support to rename - #457

Merged
klen merged 1 commit into
python-mode:developfrom
brakhane:develop
Jul 31, 2014
Merged

klen merged 1 commit into
python-mode:developfrom
brakhane:develop

Conversation

@brakhane

Copy link
Copy Markdown
Contributor

When a method is renamed, the user can choose "perform in class
hierarchy". This will rename methods of the same name in super-
and subclasses. For example, in the following

class A(object):
def foo(self): pass

class A2(A):
def foo(self): pass

class B(object):
def foo(self): pass

A normal rename in A2's foo will not rename A's foo and vice versa.
With the "in class hierarchy" mode, both will be renamed. In both
cases, class B will not be altered, as it isn't a super- or subclass.

Fixes #456

When a method is renamed, the user can choose "perform in class
hierarchy". This will rename methods of the same name in super-
and subclasses. For example, in the following

  class A(object):
    def foo(self): pass

  class A2(A):
    def foo(self): pass

  class B(object):
    def foo(self): pass

A normal rename in A2's foo will not rename A's foo and vice versa.
With the "in class hierarchy" mode, both will be renamed. In both
cases, class B will not be altered, as it isn't a super- or subclass.

Fixes python-mode#456
klen added a commit that referenced this pull request Jul 31, 2014
add class hierarchy support to rename
@klen
klen merged commit b5b03ff into python-mode:develop Jul 31, 2014
@klen

klen commented Jul 31, 2014

Copy link
Copy Markdown
Collaborator

Nice commit. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename doesn't provide "in_hierarchy" option

2 participants