I've tried to ask this on StackOverflow & got voted down & closed so, I'll try here.
PyCharm's inspections find many, many more defects when all of the types are annotated.
How do I annotate the operator example?
def add(self, x: int, y: int):
return x + y
def manipulate(self, operator, x: int, y: int):
Using type() to print() the type of operator doesn't help, functions are "function", but pycharm reports that as a syntax error, ditto for "method"
Also, I have two files, A, imports, B, B import C, C has a reference to a parent object defined in A. If I reference it in an annotation– else no intellisense and no inspection help, PyCharm then says syntax error until I add an import, but now if I run the code, I get the circular import runtime error. Fully qualified class names in the form of """:type: package.SomeType""" don't help either.