Barry A. Warsaw <ba...@python.org> added the comment: On Oct 20, 2021, at 08:28, Eric Snow <rep...@bugs.python.org> wrote: > > The only catch I see is where the module's code sets one of the attrs. Would > the proxy (or import machinery) pick those up, or maybe for some of them emit > a warning or fail? > > We could also skip the proxy and add the properties to ModuleType directly, > no?
My initial idea was to proxy from the ModuleType to the ModuleSpec and I started down that path, but hacking in C is much more painful than experimenting in Python, so that’s why I did my WIP branch (i.e. just to play with the feasibility of it). Thus I had planned to keep the actual attribute values in the ModuleSpec and essentially implement a getattro and setattro in the ModuleType that proxied sets and gets to the ModuleSpec. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33277> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com