Is there a way to hint PyDev what is the type a variable (or property) so it can provide autocompletion?
def __init__(self, p):
self.p = p #@type self.p: module.AnotherClass
self.p. # autocompletion for AnotherClass opens
You can use an isinstance assert to check it…
E.g.: assert isinstance(p, module.AnotherClass)
but it won't work for your use-case (pydev will be able to resolve p in the same scope where the isinstance was used, but can't 'see' that self.p was of the same type that p (which had the assert used).
Please add a feature request for that.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.