Inline method refactoring inserts an unexpected argument
Los mantenedores suelen responder en 7 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start by reproducing the Inline Method refactoring on Word.translate in blob.py, using the call in test.py as the target. The bad output is the __0__from_lang keyword in the inlined call, so look at how rope builds argument names when it substitutes call-site arguments. Done when the inlined call reads translate_to('string', from_lang='auto', to_lang="es") with no extra argument.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Inline method refactoring inserts an unexpected argument in the method call.
Steps to reproduce the behavior:
- Code before refactoring:
structure:
-- main
---- __init__.py
---- blob.py
-- test
---- __init__.py
---- test.py
blob.py:
class Word(str):
def translate_to(self, source, from_lang='auto', to_lang='en', host=None):
pass
def translate(self, from_lang='auto', to="en"):
return self.translate_to('string', from_lang=from_lang, to_lang=to)
test.py:
import main as tb
from unittest import TestCase
class WordTest(TestCase):
def test_translate(self, mock_translate):
mock_translate.return_value = 'gato'
assert_equal(tb.Word("cat").translate(to="es"), "gato")
-
Apply the Inline Method refactoring to the 'Word.translate' in 'blob.py'
-
Expected code after refactoring:
blob.py:
class Word(str):
def translate_to(self, source, from_lang='auto', to_lang='en', host=None):
pass
test.py:
import main as tb
from unittest import TestCase
class WordTest(TestCase):
def test_translate(self, mock_translate):
mock_translate.return_value = 'gato'
assert_equal(tb.Word("cat").translate_to('string', __0__from_lang='auto', to_lang="es"), "gato")
- Lenguaje dominante
- Python
- Estrellas
- 2.2k
- Forks
- 197
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 5
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de python-rope/rope
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
python-rope/rope#927 ·
Los mantenedores suelen responder en 7 días
-
Extract raises IndexError or ModuleSyntaxError instead of RefactoringError for an empty or whitespace-only regionPosiblemente ocupada @aliassar la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
python-rope/rope#926 ·
Los mantenedores suelen responder en 7 días
-
simplify.real_code blanks t-strings, so renames inside them edit the wrong offsetPosiblemente ocupada @sean0407 la tomó hace 11 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
python-rope/rope#913 ·
Los mantenedores suelen responder en 7 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
python-rope/rope#925 ·
Los mantenedores suelen responder en 7 días
-
Extract method/variable and introduce parameter don't check whether the new name is already in useAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 62/100
python-rope/rope#924 ·
Los mantenedores suelen responder en 7 días
Todos los issues de python-rope/rope
Issues similares
-
DBFS append mode silently overwrites existing filesPosiblemente ocupada @IlyaKhalafi la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
fsspec/filesystem_spec#2429 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Retrieval rerank fallback statistics stay zero after provider failurePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
volcengine/OpenViking#7014 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
fedora-copr/copr#4600 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ansys/pydpf-core#3620 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día