While I really like type annotations I hate that they’re little more than IDE hints.<p>There’s nothing to stop calling functions with incorrect datatypes at runtime and I’d consider this one of the single biggest weaknesses of python right now
What are your thoughts on purely static tools on that for Python?<p>Basically my latest project that I was thinking about is to write a symbolic executor for python that would simply preserve all of the required-type information for all of the execution paths of the program.<p>Also the other project is to write a tool that allows you to walk all of the possible executions of a given piece of code to find which functions are being called from it - incredibly useful for refactoring of the old code.<p>Does something like this exists already that you've used and found useful?
I think I’ve seen several of these now for python, seems very useful.<p>I hope a good one will be made soon for javascript/typescript.<p>Or maybe it’s needed less there because of typescripts type interference?
I will definitely check this out!<p>Very similar is <a href="https://google.github.io/pytype/" rel="nofollow">https://google.github.io/pytype/</a> which also infers and adds annotations, as well as providing a type checker which in some ways works better than mypy (recursive types!)
Not Python exactly but I have these situation. I am writing business server in C++ that exposes JSON based RPC API and Javascript client library to access said API.<p>I have no idea where is that claim about high productivity of these free form languages came from. In C++ in addition to the nice intellisense compiler checks everything before sending program to debug. So I do not need to do manual testing during runtime to discover typo in my code.<p>In javascript I can write literally any crap and the system lets it go. Intellisense sucks big time as well. As a result of this and usual typos I have to literally go and do a lot of clicking to see if this part blows up at runtime.<p>So all in all I'd say productivity in C++ is way better. And C++ is not a stellar example of easy language. Actually it is easy for me. Not because I am super-duper programmer but your basic coding with the help of standard library is a piece of cake. I do not really need to be an architecture astronaut and dive into any esoteric stuff. Simply not needed
Awesome. I will try this next Monday on a code base at work, I hope it will improve readability. I admit I'm a little skeptical about the adoption of optional typing if it's not going to affect performance but maybe this will change my mind.
Haven’t been involved in the Python community for awhile but isn’t already a thing? Really cool project but thought I saw something like this already existed. If I’m right, is there anything that stands this apart from its counterparts?
What's the benefit of this over simply adding the type annotations directly? I guess this is mostly for those unwilling to understand types?
Especially given the admitted limitations of inferring types, such as the add exmaple discussed; this seems to be fixing an anti-pattern problem. As this those who would build a project in Python that would largely benefit from these annotations, would be most suited to just spend the couple of hours needed to truly apply it themselves.