• 
      

    Update typing: Union[...]

    Review Request #15119 — Created June 12, 2026 and submitted

    Information

    Review Board
    release-9.x

    Reviewers

    This change updates legacy type hints that use the old Union[...] form
    to be (... | ...) instead.

    Because I want to keep this tightly focused and easy to review, this
    does not make any changes to other imports, documentation, etc., even
    within the changed lines. Those will come in future changes.

    Ran unit tests.

    Summary ID
    Update typing: Union[...]
    This change updates legacy type hints that use the old `Union[...]` form to be `(... | ...)` instead. Because I want to keep this tightly focused and easy to review, this does not make any changes to other imports, documentation, etc., even within the changed lines. Those will come in future changes. Testing Done: Ran unit tests.
    ztwqsqnlwluxkvoxvrlxvotwnqutuzxp
    Description From Last Updated

    line too long (81 > 79 characters) Column: 80 Error code: E501

    reviewbot reviewbot

    Hmm this is a bit hard to read. I'm not opposed to leaving it like this, but thoughts on this …

    maubin maubin

    Sorry forgot to flag this one too in the last review. Let's use the -> ( ... ): format here …

    maubin maubin
    Checks run (1 failed, 1 succeeded)
    flake8 failed.
    JSHint passed.

    flake8

    david
    maubin
    1. 
        
    2. reviewboard/accounts/models.py (Diff revision 2)
       
       
      Show all issues

      Hmm this is a bit hard to read. I'm not opposed to leaving it like this, but thoughts on this pattern?

      def get_profile(
          self,
          cached_only: bool = False,
          create_if_missing: bool = True,
          return_is_new: bool = False,
      ) -> (
         Profile |
         tuple[Profile | None, bool] |
         None
      ):
          """Return the profile for the User.
      
    3. 
        
    david
    maubin
    1. 
        
    2. reviewboard/accounts/models.py (Diff revision 3)
       
       
      Show all issues

      Sorry forgot to flag this one too in the last review. Let's use the

      -> (
      ...
      ):
      

      format here too.

    3. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-9.x (0b74fa2)