rope icon indicating copy to clipboard operation
rope copied to clipboard

Rename Method allows changing datamodels function names.

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

Rename Method allows changing datamodels function names.

Steps to reproduce the behavior:

  1. Code before refactoring:
class Singleton:
    _instancia = None

    def __new__(cls):
        if cls._instancia is None:
            cls._instancia = super().__new__(cls)
        return cls._instancia

a = Singleton()
b = Singleton()
print(a is b)
  1. Apply the rename method to Singleton.__new__

  2. Code after refactoring:

class Singleton:
    _instancia = None

    def get_instance(cls):
        if cls._instancia is None:
            cls._instancia = super().__new__(cls)
        return cls._instancia

a = Singleton()
b = Singleton()
print(a is b)

jonh-copin avatar Nov 24 '25 19:11 jonh-copin