python / python/cpython

Expand the reach of keyword typo suggestions

Aperta
#156,092 4 commenti 1 reazione 1 assegnatario Vedi su GitHub

@johnslavik ci sta già lavorando.

Dal 20/8/2026.

interpreter-core topic-parser type-bug
Lingua principale
Python
Stelle
77.2k
Fork
35.9k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.