INNER CODE UNIT · Python
ContextAware
volfpeter/htmy · htmy/core.py:66
class ContextAware:
"""
Base class with utilities for safe context use.
Features:
- Register subclass instance in a context.
- Load subclass instance from context.
- Wrap components within a subclass instance context.
Subclass instance registration:
Direct subclasses are considered the "base context type". Subclass instances are
registered in contexts under their own type and also under their "base context type".
Example:
```python