deputy pin-inheritance¶
Disambiguates unresolved base classes by pinning a specific definition.
When a class inherits from an ambiguous or unresolved base (e.g. a name imported from multiple locations), pin-inheritance tells deputy exactly which definition to use for MRO computation.
Usage¶
Options¶
| Flag | Description |
|---|---|
--remove / -r |
Remove an existing pin |
--list / -l |
List all pins for the current branch |
Arguments¶
| Argument | Description |
|---|---|
class_fqn |
Fully qualified name of the class to pin a base for |
base_name |
Short name of the unresolved base class |
entity_ref |
file_path:lineno[:col_offset] of the candidate to pin |
Examples¶
# Pin a base class to a specific import location
deputy pin-inheritance myapp.models.Model Base models.py:10
# List all pins for the current branch
deputy pin-inheritance --list
# Remove a pin
deputy pin-inheritance myapp.models.Model Base --remove
Finding the right entity_ref¶
- Look up the class to see its unresolved bases:
- The
unresolved_basescolumn shows candidate locations - pick the right one. - Use the module path and line number as
entity_ref.
What happens after pinning¶
After pinning or removing a pin, deputy:
- Updates the
class_basestable to reflect the new resolution - Re-runs eager inherited member resolution across all classes
INHERITED_MEMBERentities are re-created to reflect the updated MRO
Pins are branch-scoped - pinning on main does not affect other branches.