descriptors outside of classes
29 Mar
2011
29 Mar
'11
8:59 p.m.
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
4767
Age (days ago)
4769
Last active (days ago)
17 comments
7 participants
participants (7)
-
Don Spaulding
-
Eric Snow
-
Greg Ewing
-
Guido van Rossum
-
Michael Foord
-
Nick Coghlan
-
Raymond Hettinger