Mypy fails on Python 3.12 TypeAliasType compatibility branch
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Inizia dalle righe 54-56 di src/browserbase/_utils/_typing.py e riproduci il fallimento usando Python 3.12 con le dipendenze di sviluppo del repository. Verifica come l’annotazione della tupla e il type guard rappresentano entrambe le implementazioni di TypeAliasType, quindi esegui python -m mypy src. Il lavoro è completato quando il controllo rigoroso dei tipi passa su Python 3.12 preservando il narrowing previsto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 93
- Fork
- 16
- Merge medio
- 11m
- PR unite (30g)
- 3
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di browserbase/sdk-python
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
browserbase/sdk-python#182 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
browserbase/sdk-python#180 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
browserbase/sdk-python#179 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
browserbase/sdk-python#176 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
browserbase/sdk-python#175 ·
Tutte le issue di browserbase/sdk-python
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
learningequality/ricecooker#747 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
run-llama/llama_index#23199 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
KhronosGroup/glTF-Blender-IO#2769 ·