Hello there,
I am relying on PEP484 in a declarative parser/converter registry project, where the user can e.g. say "please parse a Dict[str, Tuple[pd.Dataframe, pd.Series]] from this directory".
In several places in the code I end up having to check if a given Type is parametrized or not, and find its 'base' non-parametrized type.
At present there is an unofficial way to do that : check if the cls.__origin__ field exist and is not None. Maybe this should be worth putting in the official API with a couple methods such as is_parametrized, and get_base_type. What do you think ?
Thanks for this great tool
Hello there,
I am relying on PEP484 in a declarative parser/converter registry project, where the user can e.g. say "please parse a
Dict[str, Tuple[pd.Dataframe, pd.Series]]from this directory".In several places in the code I end up having to check if a given
Typeis parametrized or not, and find its 'base' non-parametrized type.At present there is an unofficial way to do that : check if the
cls.__origin__field exist and is notNone. Maybe this should be worth putting in the official API with a couple methods such asis_parametrized, andget_base_type. What do you think ?Thanks for this great tool