Using multiple starred targets on the left side of `=` gets the error message saying "starred expressions" instead of "starred targets"
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Bug report
Bug description:
The doc says starred target as shown below:
*Memo:
- The doc also says
star_target.
If the target list contains one target prefixed with an asterisk, called a “starred” target:
But using multiple starred targets on the left side of = gets the error message saying starred expressions instead of starred targets as shown below:
*v1, *v2, *v3 = [0, 1, 2, 3, 4]
# Error
SyntaxError: multiple starred expressions in assignment
So, the error message should say starred targets as shown below:
SyntaxError: multiple starred targets in assignment
And, using a single starred target on the left side of = gets the error message saying starred assignment target as shown below:
*v = [0, 1, 2, 3, 4]
SyntaxError: starred assignment target must be in a list or tuple
So, the error message should say starred target as shown below:
SyntaxError: starred target must be in a list or tuple in assignment
CPython versions tested on:
3.12
Operating systems tested on:
Windows
Linked PRs
- gh-138283
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
issue ではソースファイルもテストも指定されていません。まず、2 つの assignment SyntaxErrors を出力する CPython の parser または compiler のエントリポイントを特定し、次にリンクされている PR gh-138283 を確認してください。メッセージがドキュメントに記載された「starred target」という表現を使用し、関連する動作がテストでカバーされていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 25/100