I believe that you should be able to check the __args__
parameter:
>>> from typing import Dict, List, Type, TypeVar
>>> List[Dict].__args__
(typing.Dict,)
>>> List[int].__args__
(<class 'int'>,)
But note from the docs:
Note The typing module has been included in the standard library on a provisional basis. New features might be added and API may change
even between minor releases if deemed necessary by the core
developers.
So this probably isn't future proof.