What does Python do differently when running with the -O (optimize) flag?
What does Python do differently when running with the -O (optimize) flag?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
assertstatements are completely eliminated, as are statement blocks of the formif __debug__: ...(so you can put your debug code in such statements blocks and just run with-Oto avoid that debug code).With
-OO, in addition, docstrings are also eliminated.