python / python/cpython

IDLE doesn't know where to start parsing

オープン
#124,451 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

topic-IDLE type-bug
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、記載されている Python バージョンで、issue にある括弧の対応付けと calltip の例を使って IDLE の解析動作を再現します。IDLE が現在のプロンプト境界をどのように決定しているかを追跡し、そのうえで、それらの例に対して括弧の対応付けと calltip が正しく動作することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
desktop, tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。