Open justuswilhelm opened 7 years ago
Well, you are not returning a dictionary in your second example. The return value is a function which returns a dictionary. Is it a typo or is it what you intended?
Sorry, that was a typo in my post above. The method should return dict()
. I tried return a dict type just now, and that does not change the error message. Which makes sense, since the decorator phase fails, not the execution phase.
In mypy you can use this
And it validates just fine.
But with enforce I get a strange result
Seemingly, the generic type handling is different in enforce.
What's the best way to get a similar behavior to mypy?