How do I provide type hints for an alternative constructor for a class? For example if I have a method like this converting something to my new class,
class MyClass:
@classmethod
def from_string(cl: Type[????], s: str) -> ????:
p, q = some_function(s)
return cl(p, q)
what should I write for ????
? It should by nature just be MyClass
, but that variable is not defined yet at the time when the method definition is executed.