Skip to content

Checking if a type is generic and correct type hint #1132

Answered by JelleZijlstra
johhnry asked this question in Q&A
Discussion options

You must be logged in to vote

I'd suggest you use a library like https://github.com/ilevkivskyi/typing_inspect. You can also typing_extensions.get_origin and get_args (backports of https://docs.python.org/3.10/library/typing.html#typing.get_args).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@johhnry
Comment options

Answer selected by johhnry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants