[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [atomic-devel] [fedora-atomic f23] remove Python source files



On 9 December 2015 at 21:48, Giuseppe Scrivano <gscrivan redhat com> wrote:
> Nick Coghlan <ncoghlan gmail com> writes:
>> There's one trick we discussed that I think is actually fairly safe:
>> using hard links to share the same set of compiled files for normal
>> execution and -O, rather than having two copies. Assuming the "-O"
>> files are used, then any asserts and "if __debug__:" blocks in the
>> system provided libraries would get skipped even in the non-optimised
>> case.
>
> thinking more of it: as the trick is quite generic and not as aggressive
> as my first proposed patch which stripped all the source code, shouldn't
> be -OO used in any case where the source code is available as well and
> not only for Atomic?

No, as -OO strips docstrings, and there's plenty of Python code that
assumes docstrings are always available. It can be a useful memory
optimisation trick as an application integrator (since you know
whether or not you're using any libraries that rely on docstrings
being present), but it's a recipe for obscure compatibility bugs as a
platform provider.

"-O" is safer, as it's much closer semantically to normal execution
(the main changes relative to the default execution mode are that
assert statements and "if __debug__:" blocks get compiled out)

Cheers,
Nick.

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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]