Let\'s say I have:
class A(object):
pass
class B(A):
pass
I want to declare a function that takes a subclass of A as an argument:
There is no way to do this using the docstring syntax for Python 2 in PyCharm or IDEA.
However, you can get code completion for the variable by placing an assert statement above the usage:
def call_foo(cls):
"""
Calls the class method ``foo`` of the given class.
:param cls: a subclass of SomeClass
:type cls: type
"""
assert issubclass(cls, SomeClass)
cls.foo() # you'll get code completion here for the foo method defined in SomeClass