[Python-ideas] LOAD_NAME/LOAD_GLOBAL should be use getattr()
Eric Snow
ericsnowcurrently at gmail.com
Tue Sep 12 22:48:00 EDT 2017
On Sep 12, 2017 10:17 AM, "Neil Schemenauer" <nas-python-ideas at arctrix.com>
wrote:
Introducing another special feature of modules to make this work is
not the solution, IMHO. We should make module namespaces be more
like instance namespaces. We already have a mechanism and it is
getattr on objects.
+1
- importlib needs to be fixed to pass modules to exec() and not
dicts. From my initial experiments, it looks like importlib gets
a lot simpler. Right now we pass around dicts in a lot of places
and then have to grub around in sys.modules to get the module
object, which is what importlib usually wants.
Without looking at the importlib code, passing around modules should mostly
be fine. There is some semantic trickiness involving sys.modules, but it
shouldn't be too bad to work around.
I have requested help in writing a PEP for this idea but so far no
one is foolish enough to join my crazy endeavor. ;-)
Yeah, good luck! :). If I weren't otherwise occupied with my own crazy
endeavor I'd lend a hand.
-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170912/3f657e5c/attachment.html>
More information about the Python-ideas
mailing list