On Fri, Dec 01, 2017 at 02:13:37AM -0600, Neil Schemenauer wrote: > I have been working on reducing Python statup time. It would be > nice if there was some way to load a module into memory without exec > of its body code. I'm sure other people have wished for this.
I don't understand why you would want to do this. Given a source file: # module.py spam = 1 eggs = 2 if you import the module without executing the code in the module, surely you'll get a bare module with nothing in it? Then: module.spam module.eggs will both fail with AttributeError. If that's what you mean, then no, I haven't wished for that. Unless I'm missing something, it seems pointless. When, and why, would I want to import an empty module? -- Steve _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/