title: Type hinting for generic singleton?
body: <p>I have a base service, which provides common methods for all services. Moreover, this <code>BaseService</code> serves as a service registry:</p>
  
  <pre><code>class BaseService:
      instances = {}
  
      @classmethod
      def get_instance(cls) -&gt; 'BaseService':
          if cls.instances.get(cls) is None:
              cls.instances[cls] = cls()
          return cls.instances[cls]
  
  class Service1(BaseService):
      pass
  
  class Service2(BaseService):
      pass
  
  Service1.get_instance()
  Service2.get_instance()
  Service1.get_instance()
  </code></pre>
  
  <p>The <code>get_instance()</code> method is returning the children class instance and I feel that the current annotation <code>-&gt; 'BaseService'</code> is incorect. How should I annotate this method properly?</p>