
March 29, 2011
7: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