How to disable inspections of code inside docstrings?

I recently upgraded to PyCharm 2.7, and I've noticed that PyCharm now has special processing for code examples inside a docstring. For example, if I have a class like the following:

class MyClass(object):
    """Process some data.

    Example usage:
   
    >>> some_function(MyClass())

    """
    pass

As long as I preface code examples with ">>> " or "... ", PyCharm now highlights the code example and performs syntax checks and code inspections. This might be useful in, say, the context of doctests.

Unfortunately, I'm finding that the inspections don't handle this code very well (for example, in the above code, some_function will be considered an "unresolved reference," even if I define it elsewhere in the module), and in general I don't really care about the syntax or coding practices I use in example code.

So is there a way to turn off inspections of code examples in docstrings? I understand why it might be useful for people who use doctests, but I sometimes just put examples in docstrings and don't want them to be inspected.
2 comments
At the moment the docstring analysis cannot be disabled. You're welcome to file a feature request at http://youtrack.jetbrains.com/ to make this optional.
0
Thank you. I have added a feature request at PY-8815.
0

Please sign in to leave a comment.