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.
Related concepts
- LEGBcontrasts with · LEGB is Python’s name-resolution order of local, enclosing-function, global, and built-in scopes.
- 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.
- static fieldused by · A static field is a named variable whose storage is associated with a class or program scope rather than separately with each object instance.
- attributeconfigures · An attribute is a named property, value, or piece of information associated with an entity, object, or program element.
- inheritanceused by · Inheritance is a mechanism by which a child type or element receives properties, values, or behavior from a parent, subject to system rules and possible overrides.
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.

