Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's horrible. Nobody needs imperative metaprogramming for type hints. In fact, it would be absolute insanity for a typechecker to check this because it would mean opening a file in VS code = executing arbitrary python code. What stops me from deleting $HOME inside make_typed_dict?

TypeScript solves this with its own syntax that never gets executed by an interpreter because types are striped when TS is compiled to JS.



>VS code = executing arbitrary python code. What stops me from deleting $HOME inside make_typed_dict?

Easy make IO calls illegal in the type checker. The type checker of course needs to execute code in a sandbox. It won't be the full python language. Idris ALREADY does this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: