[Python-ideas] Dump .pyo and the "optimize" flag

Nick Coghlan ncoghlan at gmail.com
Wed Feb 3 13:51:56 CET 2010


Brett Cannon wrote:
> On Tue, Feb 2, 2010 at 13:05, Antoine Pitrou <solipsis at pitrou.net> wrote:
>> Le mercredi 03 février 2010 à 06:58 +1000, Nick Coghlan a écrit :
>>> The fact that asserts and if __debug__ blocks get skipped under -O
>>> strikes me as more than adequate reason to consider optimised and
>>> non-optimised bytecode as different things.
>> Well, do people rely on this nowadays?
>> With unit testing becoming very common (and recommended) practice, I'm
>> not sure what sprinkling asserts in debug mode really brings.
> 
> We might not rely on them, but I am sure there are those who prefer
> them on top of TDD (or instead of). Removing them would be somewhat
> forcing a programming methodology on users which I think we should
> avoid.

As Curt said, they're a great form of executable comment, unit tests or
no unit tests.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------



More information about the Python-ideas mailing list