Update typing: Union[...]
Review Request #15119 — Created June 12, 2026 and submitted
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 |
|---|---|
| ztwqsqnlwluxkvoxvrlxvotwnqutuzxp |
| Description | From | Last Updated |
|---|---|---|
|
line too long (81 > 79 characters) Column: 80 Error code: E501 |
|
|
|
Hmm this is a bit hard to read. I'm not opposed to leaving it like this, but thoughts on this … |
|
|
|
Sorry forgot to flag this one too in the last review. Let's use the -> ( ... ): format here … |
|
- Commits:
-
Summary ID ztwqsqnlwluxkvoxvrlxvotwnqutuzxp ztwqsqnlwluxkvoxvrlxvotwnqutuzxp - Diff:
-
Revision 2 (+280 -296)
Checks run (2 succeeded)
-
-
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.
- Commits:
-
Summary ID ztwqsqnlwluxkvoxvrlxvotwnqutuzxp ztwqsqnlwluxkvoxvrlxvotwnqutuzxp - Diff:
-
Revision 3 (+290 -298)