mirror of
https://github.com/kennethreitz/responder.git
synced 2026-06-05 23:00:17 +00:00
__slots__
This commit is contained in:
+22
-1
@@ -18,7 +18,6 @@ from .status_codes import HTTP_200
|
||||
|
||||
class QueryDict(dict):
|
||||
def __init__(self, query_string):
|
||||
query_string = query_string
|
||||
self.update(parse_qs(query_string))
|
||||
|
||||
def __getitem__(self, key):
|
||||
@@ -87,6 +86,17 @@ class QueryDict(dict):
|
||||
|
||||
# TODO: add slots
|
||||
class Request:
|
||||
__slots__ = [
|
||||
"_starlette",
|
||||
"formats",
|
||||
"headers",
|
||||
"mimetype",
|
||||
"method",
|
||||
"full_url",
|
||||
"url",
|
||||
"params",
|
||||
]
|
||||
|
||||
def __init__(self, scope, receive):
|
||||
self._starlette = StarletteRequest(scope, receive)
|
||||
self.formats = None
|
||||
@@ -152,6 +162,17 @@ class Request:
|
||||
|
||||
|
||||
class Response:
|
||||
__slots__ = [
|
||||
"req",
|
||||
"status_code",
|
||||
"text",
|
||||
"content",
|
||||
"encoding",
|
||||
"media",
|
||||
"headers",
|
||||
"formats",
|
||||
]
|
||||
|
||||
def __init__(self, req, *, formats):
|
||||
self.req = req
|
||||
self.status_code = HTTP_200 #: The HTTP Status Code to use for the Response.
|
||||
|
||||
Reference in New Issue
Block a user