python / python/cpython

Expand the reach of keyword typo suggestions

Aberta
#156,092 4 comentários 1 reação 1 responsável Ver no GitHub

@johnslavik já está trabalhando nisso.

Desde 20/8/2026.

interpreter-core topic-parser type-bug
Linguagem predominante
Python
Estrelas
77.2k
Forks
36k
Métricas de merge de PRs
Métricas de PR pendentes

Descrição

Feature or enhancement

Keyword typo suggestions won't work for most realistically big source files, because

  1. we have a cap of 1024 characters of the source we recompile for probing
  2. most Python source files in practice are rather bigger

My idea is to try to shrink the source being recompiled for probing keyword typos by cutting the smallest possible window of the full source and using that window for recompilation instead. The center of the window would be in the SyntaxError reported line and offset. The window would be shortest distance line up that doesn't start with indent and any line down without a \ continuation.

As a result, keyword typo suggestions could have way further reach for realistic cases.

I might include more illustrations later. cc @pablogsal

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.