ICPO
ICPO is a mnemonic for Python attribute lookup order across an instance, its class, parent classes, and the object hierarchy.
Python Workout: 50 ten-minute exercises
A name-resolution order for locating attributes across an instance, its class, parent classes, and the object hierarchy.
- How it is used
- Guides reasoning about Python attribute access, methods, class attributes, inheritance, and subclass-specific behavior.
- How deep it goes
- Traces lookup from instance through class and parents to object, then applies it to shadowing, inheritance, and super without runtime internals.
- Examples
- Uses str.upper, Foo and Bar methods, Bowl.max_scoops, BigBowl overrides, and Employee calling Person.__init__.
- What you can do after
- Diagnose/debug attribute results, predict inherited method calls, avoid accidental shadowing, and reuse methods across subclasses.
Read how Python Workout: 50 ten-minute exercises explains ICPO →
Python Workout, Second Edition
ICPO is a mnemonic for Python attribute lookup order: instance, class, parents, and object.
- How it is used
- Explains Python attribute access, method retrieval, inheritance, class attributes, and instance shadowing.
- How deep it goes
- Works through lookup order, inheritance, shadowing, super, and subclass-specific class attributes without descending into descriptor internals.
- Examples
- Uses string methods, Person and Employee, and Bowl and BigBowl class attributes to demonstrate lookup and reuse.
- What you can do after
- Diagnose attribute-resolution surprises and design inherited methods that honor instance- or subclass-specific values.
What to know first
- constantA constant is a value or named binding treated as fixed rather than reassigned or modified during a computation, whether this is enforced by a language or followed by convention.
- constructor methodA constructor method is a type-associated operation involved in creating an instance and establishing its initial state.
- objectAn object is a distinct entity represented or manipulated within a computational system, typically as a value, data structure, resource, or instance of a type.
Related concepts
- attribute lookupimplements · Attribute lookup is Python's runtime process for resolving a named attribute through an object's instance, class, inheritance hierarchy, and base objects.
- LEGBcontrasts with · LEGB is Python’s name-resolution order of local, enclosing-function, global, and built-in scopes.
- attributeconfigures · An attribute is a named property or piece of information associated with an entity, object, or structured data item.
- static fieldused by · A static field is a named variable associated with a class or program scope, rather than stored separately for each object instance.
- inheritanceused by · Inheritance is a mechanism in which a derived type or descendant element receives properties or behavior from a parent, subject to rules that may allow specialization or overriding.
Questions about ICPO
What is ICPO?
ICPO is a mnemonic for Python attribute lookup order across an instance, its class, parent classes, and the object hierarchy.
Which Manning books explain ICPO?
Python Workout: 50 ten-minute exercises and Python Workout, Second Edition.
What should I know before learning ICPO?
Manning books that teach ICPO usually introduce constant, constructor method and object first.
What is the difference between ICPO and LEGB?
ICPO is a mnemonic for Python attribute lookup order across an instance, its class, parent classes, and the object hierarchy. LEGB is Python’s name-resolution order of local, enclosing-function, global, and built-in scopes.
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.

