3 ms·
> try to maintain > 10k LOC codebases in Python to understand what I mean. Since Python 3.5 you can use type annotations: def my_func(foo: str, bar: User)
by Rotareti 8y ago
> try to maintain > 10k LOC codebases in Python to understand what I mean.
Since Python 3.5 you can use type annotations:
def my_func(foo: str, bar: User) -> None:
baz: int = User.qux
This is a useful feature for larger code bases.
In the long run, I'm sure some org will come up with a decent Python compiler, that:
* compiles Python to C
* makes use of (optional) type annotations
* improves performance
* creates single file binaries
I guess this would be less of an effort than porting the whole Python ecosystem to e.g. Julia.
- demonshreder 8y agoNuitka (http://nuitka.net/pages/overview.html http://nuitka.net/pages/overview.html) seems to be attempting to do those.
- Rotareti 8y agoNuitka is awesome. I used it to compile a Python command line tool recently and it worked fine. In fact, it worked so well that I added a Nuitka build script to that project... But Nuitka is written and maintained by a single person [0]. I think for such a huge task (with so many edge cases) it needs more attention/support in order to become mainstream. [0]: https://github.com/Nuitka/Nuitka/graphs/contributors https://github.com/Nuitka/Nuitka/graphs/contributors