From 6e76c5a14e9e19ad91f24ce93eae8dfdb9238923 Mon Sep 17 00:00:00 2001 From: Amin Alaee Date: Fri, 1 Sep 2023 10:04:58 +0200 Subject: [PATCH] Change Response.render content argument typing --- starlette/responses.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/starlette/responses.py b/starlette/responses.py index 16380db06..bc8b23f1c 100644 --- a/starlette/responses.py +++ b/starlette/responses.py @@ -37,12 +37,12 @@ def __init__( self.body = self.render(content) self.init_headers(headers) - def render(self, content: typing.Union[str, bytes, None]) -> bytes: + def render(self, content: typing.Any) -> bytes: if content is None: return b"" if isinstance(content, bytes): return content - return content.encode(self.charset) + return content.encode(self.charset) # type: ignore def init_headers( self, headers: typing.Optional[typing.Mapping[str, str]] = None