I want to add typing to a Python function that takes in a type as an argument (actually, a subtype of a specific class), and return an instance of that type. Think a factory that takes in the specific type as an argument, e.g.:
T = TypeVar('T', bound=Animal)
def make_animal(animal_type: Type[T]) -> T: # <-- what should `Type[T]` be?
return animal_type()
(obviously this is a very simplistic example, but it demonstrates the case)
This feels like something that should be possible, but I couldn't find how to properly type-hint this.