January 2009
2 posts
1 tag
Python instance descriptors: when class...
Python descriptors are great for customizing access to attributes on a class or instance. They are a big win for tasks like mapping Python objects to data from non-Python sources (such as SQL), since mapped attributes will need to be encoded/decoded and connected to other attributes in some way.
Below is a very simple descriptor; as you can see, accessing it from both the class and the instance...
The purpose of syntax highlighting is to turn your code into a map, not The Jimi...