rope icon indicating copy to clipboard operation
rope copied to clipboard

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

Open jonh-copin opened this issue 1 year ago • 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'

jonh-copin avatar Feb 27 '24 12:02 jonh-copin