Write union types as X | Y where possible#19111
Merged
MadLittleMods merged 18 commits intoelement-hq:developfrom Nov 6, 2025
Merged
Write union types as X | Y where possible#19111MadLittleMods merged 18 commits intoelement-hq:developfrom
X | Y where possible#19111MadLittleMods merged 18 commits intoelement-hq:developfrom
Conversation
Checked, but not auto-fixed, by the Ruff rules
Not done automatically by Ruff
Leave Unions / Optionals with string types as they are, just like in source code
X | Y where possible
as `X | Y` is used not only for annotations, but also type aliases
Member
Author
|
The Thankfully, there's already a PR for enforcing Pydantic v2: #19071 |
Member
Author
|
The Pydantic update indeed fixed I believe the current Complement test failure ( |
MadLittleMods
approved these changes
Nov 6, 2025
3 tasks
3 tasks
devonh
pushed a commit
that referenced
this pull request
Nov 10, 2025
Ignore Python language refactors (`.git-blame-ignore-revs`) - #19046 - #19111 ### Pull Request Checklist <!-- Please read https://element-hq.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request --> * [x] Pull request is based on the develop branch * [x] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [x] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
aka PEP 604, added in Python 3.10
This PR has been broken down into multiple commits, to illustrate the steps used to prepare it.
Pull Request Checklist
EventStoretoEventWorkerStore.".code blocks.