Fix some typing around AppliesToURLMixin.

Review Request #14549 — Created Aug. 4, 2025 and submitted

Information

Djblets
release-5.x

Reviewers

AppliesToURLMixin had the wrong base class, using Extension instead
of ExtensionHook, which ended up breaking the typing for
initialize() and other methods for anything subclassing a hook using
AppliesToURLMixin.

This fixes that, switches to Sequence[str] instead of List[str] for
the parameter, and adds typing for the attribute.

Unit tests pass.

Verified this fixed issues I hit with some extension work.

Summary ID
Fix some typing around AppliesToURLMixin.
`AppliesToURLMixin` had the wrong base class, using `Extension` instead of `ExtensionHook`, which ended up breaking the typing for `initialize()` and other methods for anything subclassing a hook using `AppliesToURLMixin`. This fixes that, switches to `Sequence[str]` instead of `List[str]` for the parameter, and adds typing for the attribute.
d3cd07b3a710309254e5ad776c5fdab52792f720
Description From Last Updated

While we're here, can we make this default to None and initialize to [] in the constructor?

daviddavid
david
  1. 
      
  2. djblets/extensions/hooks.py (Diff revision 1)
     
     
    Show all issues

    While we're here, can we make this default to None and initialize to [] in the constructor?

  3. 
      
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.x (b25b7da)