Rename refactoring doesn't rename a function's default arguments when the renamed variable is defined in the class scope
Los mantenedores suelen responder en 7 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 50/100
Línea de trabajo
Reproduce the issue by running the Rename refactoring on the PorterStemmer class attribute in the Word example, and confirm the default argument stemmer=PorterStemmer in stem is left unchanged. Then trace why occurrence search finds the class-level assignment but not the default-argument reference in the function signature. Done when the default argument is renamed along with the attribute and the same program runs without a NameError.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Applying the Rename refactoring to the following program causes runtime problems.
Steps to reproduce the behavior:
- Code before refactoring:
import nltk
class Word:
PorterStemmer = nltk.stem.porter.PorterStemmer()
def stem(self, stemmer=PorterStemmer):
return stemmer.stem('')
-
Apply the Rename refactoring to the variable "PorterStemmer"
-
Expected code after refactoring:
import nltk
class Word:
PorterStemmer_refactored = nltk.stem.porter.PorterStemmer()
def stem(self, stemmer=PorterStemmer_refactored):
return stemmer.stem('')
- In the function "stem", the parameter type is not refactored to the new name. Code after refactoring:
import nltk
class Word:
PorterStemmer_refactored = nltk.stem.porter.PorterStemmer()
def stem(self, stemmer=PorterStemmer):
return stemmer.stem('')
- 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 10 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
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
QuantConnect/Documentation#2838 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
awslabs/route53-dynamic-dns-with-lambda#67 · 1 comentario ·
-
`SubAgents` returns a child run's `DeferredToolRequests` to the parent as a successful tool resultAbiertobug pkg:harness
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
pydantic/pydantic-ai#12405 ·
Los mantenedores suelen responder en 1 día
-
good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
good first issue help wanted
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100