Rename Method allows rename functions using datamodels function names
Steps to reproduce the behavior:
- Code before refactoring:
class Soma:
def __init__(self, a, b):
self.a = a
self.b = b
def total(self):
return self.a + self.b
s = Soma(2, 3)
print(s.total())
print(s)
-
Apply the rename method to Soma.total
-
Code after refactoring:
class Soma:
def __init__(self, a, b):
self.a = a
self.b = b
def __str__(self):
return self.a + self.b
s = Soma(2, 3)
print(s.__str__())
print(s)