python / python/cpython

IDLE doesn't know where to start parsing

Aperta
#124,451 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

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

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.

Direzione di ricerca

Inizia riproducendo il comportamento di parsing di IDLE con gli esempi di corrispondenza delle parentesi e di calltip nell’issue sulle versioni di Python elencate. Traccia come IDLE determina il limite del prompt corrente, quindi verifica che la corrispondenza delle parentesi e i calltip funzionino correttamente per quegli esempi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
desktop, tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.