Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`var-annotated` errors for iteration should point to the line where the variable is defined

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

メンテナーはふだん 1 日以内に返信

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

  • #22266 @freddyuniverse による — マージされずにクローズ

評価

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

調査の方向性

Start by tracing how mypy reports var-annotated errors for the comprehension example in the issue, comparing native and non-native parser behavior. The payload names no source files or tests, so locate the relevant error reporting and parser tests first. Done means the error points to the line where the iteration variable is defined in both parser modes.

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

説明

bug topic-error-reporting topic-parser

Bug Report

See title

To Reproduce

from typing import Never
x: Never
sum(  # non-native parser errors here
    y  # native parser errors here
    for y in x  # expected error here
)

Expected Behavior

Expected an error at # expected error here.

Actual Behavior

Got an error at either # non-native parser errors here or # native parser errors here based on the parser.

Your Environment

Reproduced in mypy-play.

  • Mypy version used: 2.4.0
  • Mypy command-line flags: N/A
  • Mypy configuration options from mypy.ini (and other config files): N/A
  • Python version used: 3.12
主要言語
Python
スター
20.7k
フォーク
3.3k
平均マージ
1日 18時間
マージ済み PR(30日)
123

環境構築

はじめの一歩

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

python/mypy のほかの issue

python/mypy の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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