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:
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.
Description
Running the repository's pinned mypy (
1.17) under supported Python 3.12 fails in the shared typing helper because_TYPE_ALIAS_TYPESis annotated as containingtype[typing_extensions.TypeAliasType], then appends the distinct stdlibtyping.TypeAliasTypeclass.Code reference
src/browserbase/_utils/_typing.py:54-56Reproduction
With Python 3.12 and the repository dev dependencies:
Actual error:
Expected behavior
The strict type-check command should pass on supported Python versions, including Python 3.12 where
typing.TypeAliasTypeexists. The tuple annotation/type guard should model both runtime implementations (or use a suitably commontype[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.