Skip to content

Commit

Permalink
specify type parameters for base class of HTTPHeaders
Browse files Browse the repository at this point in the history
  • Loading branch information
mslynch committed Sep 28, 2023
1 parent dbba24a commit 4d34def
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tornado/httputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
from asyncio import Future # noqa: F401
import unittest # noqa: F401

StrMutableMapping = collections.abc.MutableMapping[str, str]
else:
StrMutableMapping = collections.abc.MutableMapping


@lru_cache(1000)
def _normalize_header(name: str) -> str:
Expand All @@ -73,7 +77,7 @@ def _normalize_header(name: str) -> str:
return "-".join([w.capitalize() for w in name.split("-")])


class HTTPHeaders(collections.abc.MutableMapping):
class HTTPHeaders(StrMutableMapping):
"""A dictionary that maintains ``Http-Header-Case`` for all keys.
Supports multiple values per key via a pair of new methods,
Expand Down

0 comments on commit 4d34def

Please sign in to comment.