Huh, that’s convenient and really useful. When I do ridiculous import hacks, i usually just do it be importing a module, that trades the ast module to rewrite code, exec it and shim in an exit(). A preprocessor would be so much more ergonomic. I used the ast rewriting stuff mostly before dicts were all ordered - replacing fist literals with an ordered dict call, which was actually useful. I love how flexible python i…
They’re immutable. Were you directly writing to the memory location with ctypes or something?