Re: [Python-ideas] LOAD_NAME/LOAD_GLOBAL should be use getattr()

On Sep 12, 2017 10:17 AM, "Neil Schemenauer" <nas-python-ideas@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

On 2017-09-12, Eric Snow wrote:
Yeah, good luck! :). If I weren't otherwise occupied with my own crazy endeavor I'd lend a hand.
No problem. It makes sense to have a proof of concept before spending time on a PEP. If the idea breaks too much old code it is not going to happen. So, I will work on a slow but mostly compatible implementation for now. Regards, Neil

On 2017-09-12, Eric Snow wrote:
Yeah, good luck! :). If I weren't otherwise occupied with my own crazy endeavor I'd lend a hand.
No problem. It makes sense to have a proof of concept before spending time on a PEP. If the idea breaks too much old code it is not going to happen. So, I will work on a slow but mostly compatible implementation for now. Regards, Neil
participants (2)
-
Eric Snow
-
Neil Schemenauer