title: PyCharm: code completion for monkey patching
body: <p>I'm wondering if it's possible to get PyCharm to support code completion for monkey patched functions?</p>
  <p>I have the following class:</p>
  <pre><code>class _PathExt(Path):
  
      def ensure_exists(self):
          if not self.exists():
              if not self.parent.exists():
                  os.makedirs(self.parent.absolute(), exist_ok=True)
              os.makedirs(self.absolute())
          return self
  
      def subdir(self, sub_name):
          return Path(os.path.join(self.absolute(), sub_name))
  </code></pre>
  <p>Which I then monkey patch with:</p>
  <pre><code>def monkey_patch(from_type, to_type):
      for name in [x for x in dir(from_type) if not x.startswith('_') and x not in dir(to_type)]:
          value = from_type.__getattribute__(from_type, name)
          if inspect.isfunction(value):
              setattr(to_type, name, value)
  
  
  monkey_patch(_PathExt, Path)
  </code></pre>
  <p>It's understandable that this wouldn't work as it's dynamic, so I then tried:</p>
  <pre><code>Path.subdir = _PathExt.subdir
  </code></pre>
  <p>But still PyCharm won't detect it. Is this possible at all?</p>
  <p>Edit:</p>
  <p>In this specific case I've decided to derive my class from <code>Path</code> and then import my class with an <code>as</code> alias, so it's a drop in replacement, but I'd still like to know if anything can be done to support monkey patching in PyCharm.</p>