On Wed, Jun 13, 2012 at 09:54:30PM -0400, Terry Reedy wrote: > >So, no, we > > You mean the interpreter? Yes. > >should never use > > Do you mean import or execute? > Current, the interpreter executes any bytecode that gets imported. Both. > >.pyo files unless explicitly told to do so, > > What constitutes 'explicitly told to do so'? Currently, an 'optimized' > file written as .pyo gets imported (and hence executed) if > 1) the interpreter is started with -O > 2) a custom importer ignores the absence of -O > 3) someone renames x.pyo to x.pyc. Any of the above are fine by me. I oppose this one: 4) the interpreter is started without -O but there is no .pyc file. since it can lead to a mismatch between what I (the developer) thinks is being run and what is actually being run (or imported). For the avoidance of doubt, if my end-users secretly rename .pyo to .pyc files, that's my problem, not the Python's interpreter's problem. I don't expect Python to be idiot-proof. -- Steven
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4