What is the use of Python's basic optimizations mode? (python -O)

后端 未结 7 744
终归单人心
终归单人心 2020-12-25 10:24

Python has a flag -O that you can execute the interpreter with. The option will generate \"optimized\" bytecode (written to .pyo files), and given twice, it wil

7条回答
  •  渐次进展
    2020-12-25 10:41

    I have never encountered a good reason to use -O. I have always assumed its main purpose is in case at some point in the future some meaningful optimization is added.

提交回复
热议问题