I started using annotations recently. I have a singleton instance, hence I have a get_instance
method whose return value has the same type of the class the method belongs to.
class Singleton(object):
def __init__(self):
pass
def get_instance(self) -> Singleton: # Obviously the interpreter complains about undefined name
pass
What is the correct way to annotate the get_instance
method?