Rename refactoring doesn't rename a function's default arguments when the renamed variable is defined in the class scope
Mantenedores costumam responder em até 7 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 50/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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('')
- Linguagem predominante
- Python
- Estrelas
- 2.2k
- Forks
- 197
- Merge médio
- 2d 13h
- PRs com merge (30d)
- 5
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de python-rope/rope
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 88/100
python-rope/rope#927 ·
Mantenedores costumam responder em até 7 dias
-
Extract raises IndexError or ModuleSyntaxError instead of RefactoringError for an empty or whitespace-only regionTalvez já em andamento @aliassar assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
python-rope/rope#926 ·
Mantenedores costumam responder em até 7 dias
-
simplify.real_code blanks t-strings, so renames inside them edit the wrong offsetTalvez já em andamento @sean0407 assumiu há 10 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
python-rope/rope#913 ·
Mantenedores costumam responder em até 7 dias
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 30/100
python-rope/rope#925 ·
Mantenedores costumam responder em até 7 dias
-
Extract method/variable and introduce parameter don't check whether the new name is already in useAberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 62/100
python-rope/rope#924 ·
Mantenedores costumam responder em até 7 dias
Todas as issues de python-rope/rope
Issues semelhantes
-
bump patch
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
autowarefoundation/autoware_carla_scenario#1321 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 78/100
QuantConnect/Documentation#2838 ·
Mantenedores costumam responder em até 1 dia
-
get_all_subclasses must deduplicate by class identityTalvez já em andamento @Gambit-Checkmate assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 15 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
awslabs/route53-dynamic-dns-with-lambda#67 · 1 comentário ·