Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
researcher175 opened this issue Feb 27, 2024 · 0 comments
Labels
bug Unexpected or incorrect user-visible behavior rename-refactor

Comments

@researcher175
Copy link

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'
@researcher175 researcher175 added the bug Unexpected or incorrect user-visible behavior label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected or incorrect user-visible behavior rename-refactor
Projects
None yet
Development

No branches or pull requests

2 participants