On Fri, Jun 28, 2019 at 6:17 AM Ricky Teachey <ri...@teachey.org> wrote:
>
> I apologize in advance that this might be slightly off topic from the thread. 
> The idea I want to put forth is probably half baked, but I am wondering if 
> Nate's implementation might be adjusted to incorporate it, and if it might 
> solve a few of the objections.
>
> Hopefully someone hasn't already suggested it; I've tried to follow the 
> discussion about this the past couple weeks but there are a lot of messages.
>
> The elevator pitch version: add descriptors to modules.

That's mostly available already!

https://www.python.org/dev/peps/pep-0562/

# caller.py
import mod
print(mod.spam)
print(mod.eggs)

# mod.py
def __getattr__(name):
    return "<synthetic %r>" % name
spam = "ham"

rosuav@sikorsky:~/tmp$ python3 caller.py
ham
<synthetic 'eggs'>

I don't think there's any __setattr__ support, though, so this isn't
quite everything you're looking for.

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/I67UKIJVMTH7ZUTTB7YUNW62U5RFWJM2/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to