remove overlapping slots from app.Sanic, fix broken slots inherit of HTTPResponse (#2387)

This commit is contained in:
Arie Bovenberg
2022-02-24 16:45:23 +01:00
committed by GitHub
parent d4fb44e986
commit 7523e87937
5 changed files with 21 additions and 3 deletions

View File

@@ -142,7 +142,6 @@ class Sanic(BaseSanic, RunnerMixin, metaclass=TouchUpMeta):
"error_handler",
"go_fast",
"listeners",
"name",
"named_request_middleware",
"named_response_middleware",
"request_class",

View File

@@ -50,6 +50,16 @@ class BaseHTTPResponse:
The base class for all HTTP Responses
"""
__slots__ = (
"asgi",
"body",
"content_type",
"stream",
"status",
"headers",
"_cookies",
)
_dumps = json_dumps
def __init__(self):
@@ -156,7 +166,7 @@ class HTTPResponse(BaseHTTPResponse):
:type content_type: Optional[str]
"""
__slots__ = ("body", "status", "content_type", "headers", "_cookies")
__slots__ = ()
def __init__(
self,