(original) (raw)
On 6 Sep 2017, at 00:03, Larry Hastings <larry@hastings.org> wrote:
I've written a PEP proposing a language change:
https://www.python.org/dev/peps/pep-0549/The TL;DR summary: add support for property objects to modules. I've already posted a prototype.
How's that sound?
Why is there no mechanism to add new descriptors that can work in this context?
BTW. The interaction with import is interesting… Module properties only work as naive users expect when accessing them as attributes of the module object, in particular importing the name using “from module import prop” would only call the property getter once and that may not be the intended behavior.
Ronald