Skip to content

fix: support both TypeAliasType implementations - #186

Open
abhinavkr26104 wants to merge 1 commit into
browserbase:mainfrom
abhinavkr26104:fix/issue-178-type-alias-types
Open

fix: support both TypeAliasType implementations#186
abhinavkr26104 wants to merge 1 commit into
browserbase:mainfrom
abhinavkr26104:fix/issue-178-type-alias-types

Conversation

@abhinavkr26104

Copy link
Copy Markdown

Summary

  • type the runtime alias-class tuple with the common type[object] base
  • retain the existing TypeIs narrowing contract
  • cover aliases created by both typing_extensions and Python 3.12's stdlib typing

Why

On Python 3.12, typing.TypeAliasType and typing_extensions.TypeAliasType are distinct class objects. Appending the stdlib class to a tuple inferred as containing only the backport class made the repository's strict mypy check fail.

Fixes #178

Testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mypy fails on Python 3.12 TypeAliasType compatibility branch

1 participant