• 
      

    Improve invalidation checking to InvalidatableMixin.

    Review Request #15189 — Created July 21, 2026 and updated — Latest diff uploaded

    Information

    cryptozoology
    master

    Reviewers

    Initially, invalidation support was limited to BaseKey, though it
    was moved out early in development to InvalidatableMixin. The one
    piece remaining in BaseKey was check_valid(), which raised a
    KeyInvalidatedError if no longer valid.

    This change renames the exception to InvalidatedError and moves
    check_valid() out into the mixin, so that any invalidatable object can
    perform these validity checks. It's been renamed to assert_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.

    Commits

    Files