473,387 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

What does the -O flag do?

http://rgruet.free.fr/PQR25/PQR2.5.html says

"Optimize generated bytecode (also PYTHONOPTIMIZE=x). Asserts are
suppressed."

Is removing asserts all it does, where can I find more details? I'm
guessing it's not very useful as I hardly ever see it mentioned.

Jan 9 '07 #1
1 3815
Sard schrieb:
"Optimize generated bytecode (also PYTHONOPTIMIZE=x). Asserts are
suppressed."

Is removing asserts all it does, where can I find more details? I'm
guessing it's not very useful as I hardly ever see it mentioned.
It somewhat depends on the Python version. To find out precisely what
it does, search the source code for Py_OptimizeFlag. In 2.5, it

- causes the interpreter to load .pyo files, not .pyc files
(in .zip files, just makes .pyo preferred over .pyc)
- causes __debug__ to have a value of 0
- ignores assert statements in source code
- treats __debug__ statically as being 0
- causes the byte code generator to save .pyo files, not .pyc

HTH,
Martin
Jan 9 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

92
by: Reed L. O'Brien | last post by:
I see rotor was removed for 2.4 and the docs say use an AES module provided separately... Is there a standard module that works alike or an AES module that works alike but with better encryption?...
6
by: Niklaus | last post by:
Hi, Can someone point out what is wrong with this code ? How can i make it better optimize it. When run it gives me seg fault in linux. But windows it works fine(runs for a long time). Do we...
8
by: xanthviper | last post by:
Hey, I'm trying to do what I think is pretty basic here, but I am missing something. Hopefully someone can point me in the right direction. Essentially I have an enumeration set up as the...
2
by: Martin Høst Normark | last post by:
Hi everyone Has anyone got the least experience in integrating the Digital Signature with an ASP.NET Web Application? Here in Denmark, as I supose in many other countries, they're promoting...
10
by: dgk | last post by:
I'm searching for a way to determine if control values have changed. For some it's easy, such as TextBox.Modified. But looking at the radiobutton I come across IsMirrored. Curious, I look to the...
39
by: windandwaves | last post by:
Hi Folk I have to store up to eight boolean bits of information about an item in my database. e.g. with restaurant drive-through facility yellow windows
4
by: amit | last post by:
Hi guys!I am trying to write a program which will segregate some selected keywords from a given file.The source code is given alongwith #include<stdio.h> #include<string.h> char...
98
by: tjb | last post by:
I often see code like this: /// <summary> /// Removes a node. /// </summary> /// <param name="node">The node to remove.</param> public void RemoveNode(Node node) { <...> }
1
by: Gary Wessle | last post by:
Hi in the example code below, if function A or B throw, and I deal with it by setting flag to 0, does the code re-execute from the start of the try line or it resumes from the function that...
4
codemama
by: codemama | last post by:
I have created xml files in C# using the DataSet ds.WriteXml method. I now need to take an xml file and be able to do an insert or delete to a table in MS Access. How would I go about that? Do...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.