473,322 Members | 1,699 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,322 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 3796
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.