Improve invalidation checking to InvalidatableMixin.
Review Request #15189 — Created July 21, 2026 and updated
Initially, invalidation support was limited to
BaseKey, though it
was moved out early in development toInvalidatableMixin. The one
piece remaining inBaseKeywascheck_valid(), which raised a
KeyInvalidatedErrorif no longer valid.This change renames the exception to
InvalidatedErrorand moves
check_valid()out into the mixin, so that any invalidatable object can
perform these validity checks. It's been renamed toassert_valid(), to
make its purpose more clear.When used as a context manager, invalidatable objects will now start
with a validity assertion, to avoid any surprises and catch problems
early.
Unit tests pass.
| Summary | ID |
|---|---|
| 51b16ff5594badd0014a6349d507d4cd5b22acd6 |
| Description | From | Last Updated |
|---|---|---|
|
'cryptozoology.errors.InvalidatedError' imported but unused Column: 1 Error code: F401 |
|
- Change Summary:
-
Removed an unused import.
- Commits:
-
Summary ID 726f1805cff2dda9f452a8518ce3e1da2dec1051 51b16ff5594badd0014a6349d507d4cd5b22acd6 - Diff:
-
Revision 2 (+180 -114)