title: How to state, in Pydantic, that a staticmethod/classmethod returns an instance of the class in question?
body: <p>I'm working in Python 3.7 and have something like this</p>
  <pre><code>class A(object):
  
    def __init__(self, value: int):
      self.value = value
    
    @classmethod
    def factory(cls, value: int) -&gt; A:
      return A(value=value)
  </code></pre>
  <p>Yes, it's a contrived example, but I'm essentially trying to annotate the factory function to state that it returns an instance of <code>A</code>, however, this fails when I attempt to run the <code>flake8</code>  linter over the file as it complains that <code>A</code> isn't defined.</p>
  <p>Is there some way to annotate this function such that the linter won't complain?</p>