Closed
Description
Bug Report
Regression in 1.12.
I'm not sure if this is deliberate or somehow got missed, but I thought aiohttp was in the mypy test suite, so should have been caught in the regression tests..
def feed_data(
self,
data: bytes,
SEP: Optional[_SEP] = None,
*args: Any,
**kwargs: Any,
) -> Tuple[List[Tuple[RawResponseMessage, StreamReader]], bool, bytes]:
if SEP is None:
SEP = b"\r\n" if DEBUG else b"\n"
return super().feed_data(data, SEP, *args, **kwargs)
Now results in:
aiohttp/http_parser.py:684:40: error: Argument 2 to "feed_data" of "HttpParser"
has incompatible type "Literal[b'\\r\\n', b'\\n'] | None"; expected
"Literal[b'\\r\\n', b'\\n']" [arg-type]
return super().feed_data(data, SEP, *args, **kwargs)
^~~
Expected Behavior
The variable can never be None at this point, so there should be no error (as in 1.11 and previous releases).
Your Environment
- Mypy configuration options: https://github.com/aio-libs/aiohttp/blob/master/.mypy.ini
- Python version used: 3.11