Reputation: 2398
I would like PyCharm to warn me on the following python3 code:
def foo() -> str:
return 'abc'
x: int = foo() # I want to be warned here
Is there an option I can enable to get this warning?
The motivation here is that I have functions whose return-types are not as easily deducible at first glance like in this example. I want to declare what I think the types of my variables should be, for readability, and I want PyCharm to deduce whether what I think is correct.
Upvotes: 3
Views: 142