Inline method refactoring applied to rich comparison methods
I maintainer di solito rispondono entro 7 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 30/100
Direzione di ricerca
Reproduce the issue by applying Inline Method to GFG.__lt__ in the snippet from the issue body, which calls self._compare with a lambda comparison. Find the inline-method refactoring code in rope and see where it could detect that the target is a rich comparison method. Done means applying the refactoring to such a method shows a user-facing warning, and this is confirmed by a test. The issue has no comments and no maintainer decision on what the alert should look like, so ask before building it.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Inline method refactoring allows for rich comparison methods.
It would be nice if Rope sent an alert to the user to avoid applying the transformation to rich comparison methods.
Steps to reproduce the behavior:
- Code before refactoring:
class GFG:
def __init__(self, Marks):
self.Marks = Marks
def _cmpkey(self):
return self.Marks
def _compare(self, other, method):
try:
return method(self._cmpkey(), other._cmpkey())
except (AttributeError, TypeError):
return NotImplemented
def __lt__(self, other):
return self._compare(other, lambda s, o: s < o)
student1_marks = GFG(90)
student2_marks = GFG(88)
print(student1_marks < student2_marks)
print(student2_marks < student1_marks)
- Apply the Inline Method refactoring to 'GFG.__lt__'
- 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
-
cost:cheap practicality:seen-in-the-wild severity:medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
fairagro/m4.2_advanced_middleware_api#620 ·
I maintainer di solito rispondono entro 1 giorno
-
area:security effort:S priority:P2 provider:local-libvirt status:ready type:docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
randomparity/kdive#3495 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
microsoft/markitdown#2820 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni