Write union types as X | Y where possible (#19111)

aka PEP 604, added in Python 3.10
This commit is contained in:
Andrew Ferrazzutti
2025-11-06 15:02:33 -05:00
committed by GitHub
parent 6790312831
commit fcac7e0282
465 changed files with 4034 additions and 4555 deletions

View File

@@ -20,7 +20,7 @@
import re
from http import HTTPStatus
from typing import Awaitable, Callable, NoReturn, Optional
from typing import Awaitable, Callable, NoReturn
from twisted.internet.defer import Deferred
from twisted.web.resource import Resource
@@ -309,7 +309,7 @@ class OptionsResourceTests(unittest.TestCase):
class WrapHtmlRequestHandlerTests(unittest.TestCase):
class TestResource(DirectServeHtmlResource):
callback: Optional[Callable[..., Awaitable[None]]]
callback: Callable[..., Awaitable[None]] | None
async def _async_render_GET(self, request: SynapseRequest) -> None:
assert self.callback is not None