title: Python 3 type hinting for dynamic attributes through __getattr__
body: <p>To wrap all function calls of a module and access it via an wrapper class's <code>__getattr__</code> method, I tried to use <code>typing</code> library but I could not figure out on how to do this correctly.</p>
  
  <pre class="lang-py prettyprint-override"><code>import interface
  
  """
  &gt;&gt;&gt; print(interface.__all__)
  ['execute_foo_operation', ...]
  """
  
  class InterfaceWrapper(object):
      def __init__(self, job_queue):
          self.job_queue = job_queue
          self.callbacks = []
  
      def __getattr__(self, name):
          func = getattr(interface, name)
          return functools.partial(self._wrapper, func)
  
      def _wrapper(self, func, *args, **kwargs):
          job = func(*args, **kwargs)
          self.job_queue.push(job)
          for callback in self.callbacks:
              callback(job)
          return job
  
      def register_callback(self, callback):
          self.callbacks.append(callback)
  
  
  class Operator(object):
      def __init__(self, job_queue):
          self.interface = InterfaceWrapper(job_queue)
  
      def after_queuing(self):
          # do something
  
      def execute_foo_operation(self):
          self.interface.register_callback(self.after_queuing)
          self.interface.execute_foo_operation()  # unresolved attribute
  
  </code></pre>
  
  <p>Can anyone guide my code to work correctly?</p>