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 Method refactoring is allowed in methods of the descriptor protocol #771

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

Comments

@researcher175
Copy link

researcher175 commented Feb 27, 2024

Steps to reproduce the behavior:

  1. Code before refactoring:
class Descriptor:
    def __get__(self, instance, owner):
        return 40
  1. Apply the Rename Method refactoring to the method __get__.

  2. Expected code after refactoring: the same as the original. It would be nice if Rope could emit a warning that applying the refactoring to this type of class is not allowed.

Rope produces the result below:

class Descriptor:
    def value(self, instance, owner):
        return 40
@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