Expand the reach of keyword typo suggestions
@johnslavik is already working on this.
Since Aug 20, 2026.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Feature or enhancement
Keyword typo suggestions won't work for most realistically big source files, because
- we have a cap of 1024 characters of the source we recompile for probing
- 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.