Tim Peters wrote: > > [M.-A. Lemburg] > > Side note: the magic can also change due to command line options > > being used, e.g. -U will bump the magic number by 1. > > Note that this (-U) is the only such case. Unless people are using private > Python variants and adding their own cmdline switches that fiddle the magic > number <yikes>. I think that future optimizers or special combinations of the yet-to-be-designed Python compiler/VM toolkit will make some use of this feature too. It is currently the only way to prevent the interpreter from loading code which it potentially cannot execute. When redesigning the import magic, we should be careful to allow future combinations of compiler/VM to introduce new opcodes etc. so there will have to be some field for them to use too. The -U trick is really only a hack in that direction (since it modifies the compiler and thus the generated byte code). -- Marc-Andre Lemburg ______________________________________________________________________ Company: http://www.egenix.com/ Consulting: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/
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