News for hackers. Stuff that matters.
Re:Static types in Python by yawaramin on Thursday October 13, 2016 @09:26PM (#12705574)
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.

Re:Static types in Python by gglanzani on Friday October 14, 2016 @01:43AM (#12706335)
This 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)