get_generic_alias
Get the generic alias for a type.
Given a type, its generic alias from typing
module will be returned
if it exists. For example:
This is mostly useful for python versions prior to 3.9, to get a version
of a concrete type which supports __class_getitem__
. In 3.9+ types like
list
/dict
/etc are subscriptable and can be used directly instead
of their generic alias version.
Signature:
Parameters:
-
type_:
- Type
-
Type