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

I wonder if Python could similarly have opt-in optimization (‘-Osomething’) for those who are sure it won't break anything. Though I guess the standard lib might get in the way immediately.


CPython already has -O and -OO, they just don't do much that's useful (and are mostly detrimental): -O will skip asserts and set __debug__ to False, -OO will also remove docstrings.

CPython's compilation pipeline just has a fairly straightforward peephole optimiser: https://github.com/python/cpython/blob/master/Python/peephol...


You're describing opt-in pessmisation, not opt-in optimization.




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

Search: