Attribute lookup
Attribute lookup is Python's runtime process for resolving a named attribute through an object's instance, class, inheritance hierarchy, and base objects.
Python Workout: 50 ten-minute exercises
Attribute lookup is the runtime process Python uses to resolve a named attribute accessed through an object.
- How it is used
- Resolves named attributes on objects and explains how instance method calls reach definitions stored on classes.
- How deep it goes
- Explains the ICPO search order and method retrieval, while stopping before detailed descriptor or invocation internals.
- Examples
- Uses string.upper, Foo and Bar method calls, and inheritance diagrams to illustrate lookup across instances, classes, and parents.
- What you can do after
- Evaluate why an instance method call succeeds when the method is defined on its class or an inherited parent.
Read how Python Workout: 50 ten-minute exercises explains attribute lookup →
Python Workout, Second Edition
Attribute lookup is Python's process for resolving an attribute name through an object's instance, class, inheritance hierarchy, and ultimate base object.
- How it is used
- Applies attribute lookup to reason about instance attributes, class attributes, and inherited methods.
- How deep it goes
- Defines lookup across instances, classes, inheritance, and the ultimate base object, with examples of inherited methods.
- Examples
- Uses Foo and Bar inheritance, instance attribute x, inherited methods, and dataclass fields as concrete examples.
- What you can do after
- Evaluate how Python resolves an attribute on an instance and identify whether inheritance supplies the requested behavior.
Read how Python Workout, Second Edition explains attribute lookup →
What to know first
- constructor methodA constructor method is a type-associated operation involved in creating an instance and establishing its initial state.
Related concepts
- ICPOimplemented by · ICPO is a mnemonic for Python attribute lookup order across an instance, its class, parent classes, and the object hierarchy.
- attributeaddresses · An attribute is a named property or piece of information associated with an entity, object, or structured data item.
Questions about attribute lookup
What is attribute lookup?
Attribute lookup is Python's runtime process for resolving a named attribute through an object's instance, class, inheritance hierarchy, and base objects.
Which Manning books explain attribute lookup?
Python Workout: 50 ten-minute exercises and Python Workout, Second Edition.
What should I know before learning attribute lookup?
Manning books that teach attribute lookup usually introduce constructor method first.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

