IDLE doesn't know where to start parsing
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Bug report
Bug description:
After making a typo in IDLE, I noticed some unexpected calltips and incorrectly matched parentheses. These seem to be caused by the parser not knowing where the current prompt begins. I'll try to send in a PR tonight.
Examples
Parentheses are incorrectly matched:
>>> (1 2
...
SyntaxError: '(' was never closed
>>> ) # IDLE highlights this as the closing paren
Matching parentheses aren't detected (from #85560):
>>> (1 if 0
else 0) # IDLE beeps here, not detecting the opening paren
Calltip appears unexpectedly (Python 3.12; a new error message hides this issue in the latest version):
>>> (1 2
...
SyntaxError: incomplete input
>>> ( # this opens the calltip for `input`
CPython versions tested on:
3.12, CPython main branch
Operating systems tested on:
macOS
Linked PRs
- gh-124554
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.
Research direction
Start by reproducing the IDLE parsing behavior with the parenthesis-matching and calltip examples in the issue on the listed Python versions. Trace how IDLE determines the current prompt boundary, then verify that matching parentheses and calltips behave correctly for those examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- desktop, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100