[Python-Dev] deprecating .pyo and -O (original) (raw)

"Martin v. Löwis" martin at v.loewis.de
Thu Jun 14 22:57:40 CEST 2012


I don't really see the point. In my experience there is no benefit to removing assert statements in production mode. This is a C-specific notion that doesn't really map very well to Python code. Do other high-level languages have similar functionality?

It's not at all C specific. C# also has it:

http://msdn.microsoft.com/en-us/library/ttcc4x86(v=vs.80).aspx

Java makes it a VM option (rather than a compiler option), but it's still a flag to the VM (-enableassertions):

http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/java.html

Delphi also has assertions that can be disabled at compile time.

Regards, Martin



More information about the Python-Dev mailing list