rope icon indicating copy to clipboard operation
rope copied to clipboard

Rename Method refactoring is allowed in methods of the descriptor protocol

Open jonh-copin opened this issue 1 year ago • 0 comments

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

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