
On Tue, Dec 8, 2009 at 11:51 AM, Brett Cannon <brett@python.org> wrote:
Another way that a sys.dont_read_bytecode flag would be helpful is for VMs that don't use Python bytecode (e.g. Jython). They could set this flag to True by default which allows code to introspect on the VM to see if it is using bytecode or not. Plus it would let importlib easily skip bytecode usage on VMs that don't support it instead of trying to come up with some heuristic to pick up on that fact (I have not figured that one out yet, but Jython folk were thinking about having marshal.loads() always throw an exception).
It would also be useful when benchmarking multiple iterations of the same VM. I've considered implementing something like this for Unladen Swallow so that we could more effectively isolate the running binary from global state (with a sys.dont_read_bytecode command-line flag doing for bytecode files what -E does for environment variables). +1 for this in mainline. Collin Winter