Search code examples
pythondescriptornew-style-class

Descriptors and python-provided attributes


I am learning Python, and I am trying to understand descriptors better. When I look at this Python online book: http://www.cafepy.com/article/python_attributes_and_methods/ch01s05.html, it says:

  1. If attrname is a special (i.e. Python-provided) attribute for objectname, return it.

I don't understand what Python-provided means. Can someone give me an exemple of such Python-provided attribute that would take precedence over the usual resolution order?

Note: I am only interested in new-style classes (as descriptors don't even apply to old-style as far as I know).


Solution

  • As you guessed, step 1 is flat-out wrong and doesn't exist.