3 ms·
Sorry, what are you talking about? Python runtime still does its existing dynamic type checking. You can still get a TypeError at runtime if you try hard enough
by yawaramin 10y ago
Sorry, what are you talking about? Python runtime still does its existing dynamic type checking. You can still get a TypeError at runtime if you try hard enough.
Mypy is not about optimising anything, it's about static correctness guarantees. If you're developing PyPy, type hints shouldn't be making your life any better or worse.
Lastly, the 'direction' you describe that everyone else seems to be taking, is the exact same direction mypy has taken. Type annotations are only required at the method/function level.
- gglanzani 10y agoThis is not correct (try returning a defaultdict). That is the reason that Python 3.6 added a new inline type hint syntax My_dict: defaultdict[int, List[int]] = defaultdict(int)