python-rope/rope

Rename Field refactoring allows you to change the method parameter, causing inconsistent override

researcher175 opened this issue · 0 comments

Rename Field refactoring allows you to change the method parameter, causing inconsistent override
It would be nice if Rope sent an alert to prevent the user from changing the overridden method signature

  1. Steps to reproduce the behavior:
from abc import abstractmethod


class BaseTagger:
    @abstractmethod
    def tag(self, text, tokenize=True):
        return


class PatternTagger(BaseTagger):
    def tag(self, text, tokenize=True):
        if not isinstance(text, str):
            text = text.raw
        return [text, tokenize]
  1. Apply the Rename Field refactoring with the new name 'tag' to the field 'PatternTagger.tag.text'