Rename Method allows changing datamodels function names.
維護者通常 6 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
Start with the rename refactoring in rope's refactor package, where the rename method is applied to a function definition, and check how it treats special methods such as __new__. Reproduce with the Singleton snippet in the issue to see that the definition is renamed while the super().__new__ call is left alone. The issue does not say whether dunder methods should be refused or renamed differently, so confirm the intended behavior with the maintainers before changing code.
由索引模型根據 Issue 內容生成。
描述
Rename Method allows changing datamodels function names.
Steps to reproduce the behavior:
- 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)
-
Apply the rename method to
Singleton.__new__ -
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)
- 主要語言
- Python
- 星號
- 2.2k
- 分支
- 197
- 平均合併
- 2 天 20 小時
- 30 天內合併 PR
- 9
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
python-rope/rope 的其他 Issue
-
難度 1/5 1-3 小時 新手友好度 88/100
python-rope/rope#927 ·
維護者通常 6 天內回覆
-
Extract raises IndexError or ModuleSyntaxError instead of RefactoringError for an empty or whitespace-only region可能已有人在做 @aliassar 於 4 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
python-rope/rope#926 ·
維護者通常 6 天內回覆
-
simplify.real_code blanks t-strings, so renames inside them edit the wrong offset可能已有人在做 @sean0407 於 15 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 83/100
python-rope/rope#913 ·
維護者通常 6 天內回覆
-
Implement nonlocal variables scoping rule for rename refactor可能已有人在做 @ryanchou1994 於 2 天前認領。 未關閉bug
難度 4/5 3-5 天 新手友好度 48/100
python-rope/rope#935 ·
維護者通常 6 天內回覆
-
難度 4/5 3-5 天 新手友好度 30/100
python-rope/rope#925 ·
維護者通常 6 天內回覆
相似的 Issue
-
community enhancement
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 84/100
NVIDIA/auto-ontology#463 ·
維護者通常 1 天內回覆
-
Update Atari link on Gymnasium docs page可能已有人在做 @qwist1233-cpu 今天認領。 未關閉help wanted
難度 2/5 1-3 小時 新手友好度 66/100
Farama-Foundation/Gymnasium#1845 ·
維護者通常 1 天內回覆
-
難度 1/5 1-3 小時 新手友好度 91/100
WingedGuardian/GENesis-AGI#4101 ·
維護者通常 1 天內回覆