kedra marbun wrote:
i wonder what are the reasons for not passing the class on which the descriptor is attached to, what pattern is encouraged by this?
The same answer applies. It's assumed that you will be writing a custom piece of code for each attribute of each class, and giving each one its own descriptor. By the time you get to the get or set method of a descriptor, you've already dispatched on both the class and attribute name. There is not usually any point in funnelling things back into a single function and then dispatching on the class or name again. Passing the class or name would just add overhead that was unnecessary in the majority of use cases. -- Greg -- http://mail.python.org/mailman/listinfo/python-list