Mypy fails on Python 3.12 TypeAliasType compatibility branch
まだ誰も着手していません。
評価
調査の方向性
src/browserbase/_utils/_typing.py の54-56行目から始め、リポジトリの開発依存関係を使って Python 3.12 で失敗を再現します。タプルのアノテーションと type guard が両方の TypeAliasType 実装をどのように表現しているかを確認し、その後 python -m mypy src を実行します。Python 3.12 で厳密な型チェックに成功し、意図した narrowing が維持されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
Running the repository's pinned mypy (1.17) under supported Python 3.12 fails in the shared typing helper because _TYPE_ALIAS_TYPES is annotated as containing type[typing_extensions.TypeAliasType], then appends the distinct stdlib typing.TypeAliasType class.
Code reference
src/browserbase/_utils/_typing.py:54-56
Reproduction
With Python 3.12 and the repository dev dependencies:
python -m mypy src
Actual error:
src/browserbase/_utils/_typing.py:56: error: Argument 2 to <tuple> has incompatible type
type[typing.TypeAliasType]; expected type[typing_extensions.TypeAliasType] [arg-type]
Expected behavior
The strict type-check command should pass on supported Python versions, including Python 3.12 where typing.TypeAliasType exists. The tuple annotation/type guard should model both runtime implementations (or use a suitably common type[object] representation while preserving narrowing).
Actual behavior
Mypy reports a source error on Python 3.12. The current CI lint job uses the repository's minimum Python selected by .python-version, so this version-dependent branch is not checked.
Why it matters
This is a core/shared typing utility used to recognize both stdlib and backport aliases. A Python-version matrix for type checking would catch this class of conditional typing regression.
- 主要言語
- Python
- スター
- 93
- フォーク
- 16
- 平均マージ
- 11分
- マージ済み PR(30日)
- 3
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
browserbase/sdk-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
browserbase/sdk-python#182 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
browserbase/sdk-python#180 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
browserbase/sdk-python#179 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
browserbase/sdk-python#176 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
browserbase/sdk-python#175 ·
browserbase/sdk-python の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
canonical/paas-charm#368 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
StevenBlack/hosts#3256 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
qualcomm/qai-appbuilder#275 ·