Rename Method allows changing datamodels function names.
I maintainer di solito rispondono entro 7 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 35/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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)
- Lingua principale
- Python
- Stelle
- 2.2k
- Fork
- 197
- Merge medio
- 2g 13h
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di python-rope/rope
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
python-rope/rope#927 ·
I maintainer di solito rispondono entro 7 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
python-rope/rope#926 ·
I maintainer di solito rispondono entro 7 giorni
-
simplify.real_code blanks t-strings, so renames inside them edit the wrong offsetForse già presa @sean0407 l’ha presa 10 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
python-rope/rope#913 ·
I maintainer di solito rispondono entro 7 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
python-rope/rope#925 ·
I maintainer di solito rispondono entro 7 giorni
-
Extract method/variable and introduce parameter don't check whether the new name is already in useAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
python-rope/rope#924 ·
I maintainer di solito rispondono entro 7 giorni
Tutte le issue di python-rope/rope
Issue simili
-
New InternshipApertanew_internship
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
get_graph warns that the oneway column is missing when no way has a oneway tagForse già presa @HTenkanen l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cython/cython#8110 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
fix: security 🔐 style: article/section 📝 system: data-mgmt 🗃️ system: security 🔐 system: software 💻
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
uabrc/uabrc.github.io#1267 ·
-
Link Checker ReportApertaBot Type: Bug Type: Documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno