[Python-ideas] descriptors outside of classes

Eric Snow ericsnowcurrently at gmail.com
Tue Mar 29 19:59:40 CEST 2011


Here's another outlandish idea.  How about if descriptors could be used
outside of classes.  I.e. any global or local variable could be assigned a
descriptor object and the descriptor protocol would be respected for that
variable.  This would be a pretty messy change, and I have no illusions that
the idea will go anywhere.  However, would there be room for this in python?

The advantage is that it would allow for greater flexibility in hacking
things up.  The downside is that it hides what's really going on.
 Descriptors  on classes are already less-than-obvious if you aren't
familiar with how variables are handled on objects.  I would expect that
descriptors in the global namespace would be even more-so.

-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20110329/b84a14a8/attachment.html>


More information about the Python-ideas mailing list