3 ms·
It would be great to still have static constraints as an option though. I absolutely love the free form in the prototype phase, but once I've got that one nail
by y4mi 9y ago
It would be great to still have static constraints as an option though.
I absolutely love the free form in the prototype phase, but once I've got that one nailed and want to make it maintainable... well, I always miss it at that time.
- kumarvvr 9y agoIt can be done partially with type-hinting in python. However, quickly iterating through to a solution and then optimizing it in a static language is a workflow that can be adopted. However, that may be necessary for only the most critical parts of an application. With software development moving towards distributed computing, there is a lot of breathing space for languages like Python.
- deleted 9y ago[deleted]
- ageofwant 9y agoYea thats what mypy is for, and that fits my workflow too: Rapidly prototype once the API has stabilised, I add the typehints. For unfammilliar codebases using MonkeyType is now a option too.
- nicolaslem 9y agoI started using type hints and it greatly improves the readability and sometimes catches a mistake. But would love for it to be more. Maybe a flag to the interpreter that would raise an exception each time it detects an inconsistency at runtime. I can imaging turning this feature on in a staging environment.
- deleted 9y ago[deleted]
- ATsch 9y agoFrom my understanding, this should be possible by setting the sys.settrace hook. It would slow down every function call, but I'm surprised it looks like nobody has done it yet.