Skip to content

Commit

Permalink
a few more annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
glyph committed Jan 11, 2024
1 parent 5c6a94b commit 1a3b62c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/twisted/web/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
from email import message_from_bytes
from email.message import EmailMessage
from io import BytesIO
from typing import AnyStr, Callable, List, Optional, Tuple
from typing import AnyStr, Callable, Dict, List, Optional, Tuple
from urllib.parse import (
ParseResultBytes,
unquote_to_bytes as unquote,
Expand All @@ -132,8 +132,6 @@
from twisted.python.components import proxyForInterface
from twisted.python.deprecate import deprecated
from twisted.python.failure import Failure

# twisted imports
from twisted.web._responses import (
ACCEPTED,
BAD_GATEWAY,
Expand Down Expand Up @@ -859,7 +857,7 @@ class Request:
_disconnected = False
_log = Logger()

def __init__(self, channel, queued=_QUEUED_SENTINEL):
def __init__(self, channel: HTTPChannel, queued: object = _QUEUED_SENTINEL) -> None:
"""
@param channel: the channel we're connected to.
@param queued: (deprecated) are we in the request queue, or can we
Expand All @@ -875,9 +873,9 @@ def __init__(self, channel, queued=_QUEUED_SENTINEL):
self.host = self.channel.getHost()

self.requestHeaders: Headers = Headers()
self.received_cookies = {}
self.received_cookies: Dict[bytes, bytes] = {}
self.responseHeaders: Headers = Headers()
self.cookies = [] # outgoing cookies
self.cookies: List[bytes] = [] # outgoing cookies
self.transport = self.channel.transport

if queued is _QUEUED_SENTINEL:
Expand Down

0 comments on commit 1a3b62c

Please sign in to comment.