python / python/cpython

Expand the reach of keyword typo suggestions

Ouverte
#156,092 4 commentaires 1 réaction 1 personne assignée Voir sur GitHub

@johnslavik y travaille déjà.

Depuis le 20/8/2026.

interpreter-core topic-parser type-bug
Langage dominant
Python
Étoiles
77.2k
Forks
36k
Métriques de merge des PR
Métriques de PR en attente

Description

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

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.