[Python-Dev] #12982: Should -O be required to *read* .pyo files?

Terry Reedy tjreedy at udel.edu
Thu Jun 14 05:06:53 CEST 2012


On 6/13/2012 10:47 PM, R. David Murray wrote:
> On Thu, 14 Jun 2012 11:48:08 +1000, Nick Coghlan<ncoghlan at gmail.com>  wrote:

>> Right, but by resorting to either of those approaches, people are
>> clearly doing something that isn't formally supported by the core.

That was not clear to me until I read your post -- the key word being 
formally (or officially). I see now that distributing a sourceless 
library as a mixture of .pyc and .pyo files is even crazier that I thought.

>> Yes, you can do it, and most of the time it will work out OK, but any
>> weird glitches that result are officially *not our problem*.
>>
>> The main reason this matters is that the "__debug__" flag is
>> *supposed* to be process global - if you check it in one place, the
>
> OK, the above are the two concrete reasons I have heard in this thread
> for continuing the current behavior:
>
>      1) we do not wish to support running from .pyo files without -O
>         being on, even if it currently happens to work
>
>      2) the __debug__ setting is supposed to be process-global
>
> Both of these are good reasons.  IMO the issue should be closed with a
> documentation fix, which could optionally include either or both of the
> above motivations.

I agree. We have gotten what we need from this thread.

-- 
Terry Jan Reedy



More information about the Python-Dev mailing list