internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: aio-libs/aiohttp

Issue:
access_log_class can't be used in handle_args of aiohttp.web.Application
## Long story short

I'm setting up a project with a custom access logger. My code looks like:

```python
# main.py
import asyncio

from aiohttp import web
from aiohttp.abc import AbstractAccessLogger


class AccessLogger(AbstractAccessLogger):

    def log(self, request, response, time):
        self.logger.info(f'{request.remote} '
                         f'"{request.method} {request.path} '
                         f'done in {time}s: {response.status}')


loop = asyncio.get_event_loop()

app = web.Application(
    loop=loop,
    handler_args={
         'access_log_class': AccessLogger,
    },
)
```

When I run it with gunicorn:
```
gunicorn main:app --bind localhost:8080 --worker-class aiohttp.worker.GunicornWebWorker
```

An error is raised:
```
TypeError: type object got multiple values for keyword argument 'access_log_class'
```

Turns out `handler_args` overrides every keyword argument of `Application.make_handler()`, except `access_log_class`.

## Expected behaviour

Using `access_log_class` in `handler_args` and my given value replace the default `aiohttp.helpers.AccessLogger`.

## Actual behaviour

```
TypeError: type object got multiple values for keyword argument 'access_log_class'
```

## Steps to reproduce

Setup a file with the contents of `main.py` above and run it with the `gunicorn` command above.

## Your environment

python 3.6.6
```
$ pip freeze
aiohttp==3.3.2
async-timeout==3.0.0
attrs==18.1.0
chardet==3.0.4
gunicorn==19.9.0
idna==2.7
idna-ssl==1.1.0
multidict==4.3.1
yarl==1.2.6
```



Discussion:
Also running into this

Resolving patch:
diff --git a/aiohttp/web_app.py b/aiohttp/web_app.py
--- a/aiohttp/web_app.py
+++ b/aiohttp/web_app.py
@@ -293,12 +293,12 @@ def _make_handler(self, *,
         self.freeze()
 
         kwargs['debug'] = self.debug
+        kwargs['access_log_class'] = access_log_class
         if self._handler_args:
             for k, v in self._handler_args.items():
                 kwargs[k] = v
 
         return Server(self._handle, request_factory=self._make_request,
-                      access_log_class=access_log_class,
                       loop=self.loop, **kwargs)
 
     def make_handler(self, *,


Test patch:
diff --git a/tests/test_web_app.py b/tests/test_web_app.py
--- a/tests/test_web_app.py
+++ b/tests/test_web_app.py
@@ -95,6 +95,13 @@ def log(self, request, response, time):
                            request_factory=app._make_request,
                            loop=loop, debug=mock.ANY)
 
+    app = web.Application(handler_args={'access_log_class': Logger})
+    app._make_handler(access_log_class=Logger, loop=loop)
+    srv.assert_called_with(app._handle,
+                           access_log_class=Logger,
+                           request_factory=app._make_request,
+                           loop=loop, debug=mock.ANY)
+
 
 def test_app_make_handler_raises_deprecation_warning(loop):
     app = web.Application()
Repository: aio-libs/aiohttp

Issue:
request.content.iter_chunks() stalls when content is empty.
## Long story short
The title says it all.

Shouldn't [EmptyStreamReader.readchunk](https://github.com/aio-libs/aiohttp/blob/master/aiohttp/streams.py#L470) on its face `return (b'', True)` and not `return (b'', False)` ?

Without it, the special EOS chunk is never sent...
request.content.iter_chunks() stalls when content is empty.
## Long story short
The title says it all.

Shouldn't [EmptyStreamReader.readchunk](https://github.com/aio-libs/aiohttp/blob/master/aiohttp/streams.py#L470) on its face `return (b'', True)` and not `return (b'', False)` ?

Without it, the special EOS chunk is never sent...


Discussion:
Could you please describe your scenario in more detail?
Could you please describe your scenario in more detail?

Resolving patch:
diff --git a/aiohttp/streams.py b/aiohttp/streams.py
--- a/aiohttp/streams.py
+++ b/aiohttp/streams.py
@@ -482,7 +482,7 @@ async def readany(self) -> bytes:
         return b''
 
     async def readchunk(self) -> Tuple[bytes, bool]:
-        return (b'', False)
+        return (b'', True)
 
     async def readexactly(self, n: int) -> bytes:
         raise asyncio.streams.IncompleteReadError(b'', n)


Test patch:
diff --git a/tests/test_streams.py b/tests/test_streams.py
--- a/tests/test_streams.py
+++ b/tests/test_streams.py
@@ -750,7 +750,7 @@ async def test_empty_stream_reader() -> None:
     assert await s.read() == b''
     assert await s.readline() == b''
     assert await s.readany() == b''
-    assert await s.readchunk() == (b'', False)
+    assert await s.readchunk() == (b'', True)
     with pytest.raises(asyncio.IncompleteReadError):
         await s.readexactly(10)
     assert s.read_nowait() == b''
Repository: aio-libs/aiohttp

Issue:
Design good distribution extras support
Follow-up https://github.com/aio-libs/aiohttp/pull/2312#issuecomment-339335603: this issue is intended to encourage discussion about adding extras support.

There's several optional dependencies mentioned in docs, and they instruct users to do `pip install {{dep_name}}`.

Common practice is to add feature-flags allowing to depend on certain additional ability of the framework w/o having to install those dependencies manually.

For example, aiohttp could have `speedups` extra and then user's could've just `pip install aiohttp[speedups]` instead of `pip install aiodns aiohttp cchardet`.

Also, it is possible to use environment markers as extra names, in this case certain dependencies get installed automatically if the environment matches specific expression, which might be useful for windows-only crutches etc.

Please consider treating extras as a **public API**, because they are exposed to end-users.

/cc: @asvetlov 


Discussion:
I like the proposal, please go ahead
Can we close it? 
#3412 is merged.
Let's keep it for discussion and close upon final edits. It's a public API, we'll end up maintaining it as accepted, remember?
Agree
`charset-guessing-speedup`, `async-dns` and `brotli-compression`?

cc @WouldYouKindly
Perhaps my type speed is not enough for `pip install aiohttp[charset-guessing-speedup,async-dns,brotli-compression]`.

I'm starting to wonder if we need separate entry points for every feature. One point for installing everything is better maybe? If a user wants something specific -- he can learn from `extra_requires` what to install.
@webknjaz @asvetlov why not just `speedups`, `async-dns`, and `brotli`? 

`charset-guessing-speedup` / `speedups`
Those who want speed either don't really care where it comes from, or are willing to look into `setup.py` and see exact libraries — so I see no need for such a descriptive name. If later you add more speedups, extras API would not need to change.

`brotli` — the word is almost always used for a compression algorithm, so we may omit that part.
To avoid the naming problem we can add only `pip install aiohttp[all]` for everything. 
No extras for cchardet, aiodns, and brotli; at least for now.
I think it would be better to limit support of extras by two cases: all extras on and all extras off. Otherwise we'll be burried by exponential growing combinations of those which need to support. 

Is there a case when you need just some specific ones?
:-1: for `all` — it's too "pointing to nowhere", all is not descriptive.
:+1: for `speedups` — communicates intention to the user better.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -151,6 +151,13 @@ def read(f):
     packages=['aiohttp'],
     python_requires='>=3.5.3',
     install_requires=install_requires,
+    extras_require={
+        'speedups': [
+            'aiodns',
+            'brotlipy',
+            'cchardet',
+        ],
+    },
     tests_require=tests_require,
     setup_requires=pytest_runner,
     include_package_data=True,


Test patch:
Repository: aio-libs/aiohttp

Issue:
Cleanup errors are silenced by gunicorn worke
GunicornWebWorker explicitly suppresses all exceptions when calling `_run` method. Thus any exception in on_cleanup handler passes silently and farther handlers of the signal (if any) are not called. 

There is a plenty of places in aiohttp probably with the same problem:
```
$ grep --include='*.py' -nF 'with suppress(Exception)' -R aiohttp
aiohttp/client_proto.py:70:            with suppress(Exception):
aiohttp/connector.py:139:            with suppress(Exception):
aiohttp/helpers.py:464:        with suppress(Exception):
aiohttp/helpers.py:517:            with suppress(Exception):
aiohttp/web_protocol.py:518:                with suppress(Exception):
aiohttp/worker.py:71:        with suppress(Exception):  # ignore all finalization problems
```


Discussion:
[GitMate.io](https://gitmate.io) thinks the contributor most likely able to help you is @asvetlov.

Possibly related issues are https://github.com/aio-libs/aiohttp/issues/3242 (Error), https://github.com/aio-libs/aiohttp/issues/1203 (CookieJar error), https://github.com/aio-libs/aiohttp/issues/429 (Websocket error), https://github.com/aio-libs/aiohttp/issues/816 (Logging error), and https://github.com/aio-libs/aiohttp/issues/1762 (secure_proxy_ssl_header with gunicorn).

Resolving patch:
diff --git a/aiohttp/worker.py b/aiohttp/worker.py
--- a/aiohttp/worker.py
+++ b/aiohttp/worker.py
@@ -5,7 +5,6 @@
 import re
 import signal
 import sys
-from contextlib import suppress
 from types import FrameType
 from typing import Any, Optional  # noqa
 
@@ -68,8 +67,10 @@ def run(self) -> None:
         self.loop.run_until_complete(self._runner.setup())
         self._task = self.loop.create_task(self._run())
 
-        with suppress(Exception):  # ignore all finalization problems
+        try:  # ignore all finalization problems
             self.loop.run_until_complete(self._task)
+        except Exception as error:
+            self.log.exception(error)
         if sys.version_info >= (3, 6):
             if hasattr(self.loop, 'shutdown_asyncgens'):
                 self.loop.run_until_complete(self.loop.shutdown_asyncgens())


Test patch:
Repository: aio-libs/aiohttp

Issue:
Bump trustme dep to v0.5.0
## Long story short

Revert #3506 and bump dep to `trustme==0.5.0`.
Ref: python-trio/trustme#41 && python-trio/trustme#42

## Expected behaviour

linux32 tests will be green and release flow will be unblocked

## Actual behaviour

linux32 manulinux1 image tests traceback

## Steps to reproduce

N/A

## Your environment

docker manylinux1_i686 linux32


Discussion:

Resolving patch:
diff --git a/aiohttp/tracing.py b/aiohttp/tracing.py
--- a/aiohttp/tracing.py
+++ b/aiohttp/tracing.py
@@ -1,5 +1,5 @@
 from types import SimpleNamespace
-from typing import TYPE_CHECKING, Awaitable, Callable, Type
+from typing import TYPE_CHECKING, Awaitable, Callable, Type, Union
 
 import attr
 from multidict import CIMultiDict  # noqa
@@ -11,7 +11,24 @@
 if TYPE_CHECKING:  # pragma: no cover
     from .client import ClientSession  # noqa
 
-    _Signal = Signal[Callable[['TraceConfig'], Awaitable[None]]]
+    _SignalArgs = Union[
+        [ClientSession, SimpleNamespace, 'TraceRequestStartParams'],
+        [ClientSession, SimpleNamespace, 'TraceRequestEndParams'],
+        [ClientSession, SimpleNamespace, 'TraceRequestExceptionParams'],
+        [ClientSession, SimpleNamespace, 'TraceConnectionQueuedStartParams'],
+        [ClientSession, SimpleNamespace, 'TraceConnectionQueuedEndParams'],
+        [ClientSession, SimpleNamespace, 'TraceConnectionCreateStartParams'],
+        [ClientSession, SimpleNamespace, 'TraceConnectionCreateEndParams'],
+        [ClientSession, SimpleNamespace, 'TraceConnectionReuseconnParams'],
+        [ClientSession, SimpleNamespace, 'TraceDnsResolveHostStartParams'],
+        [ClientSession, SimpleNamespace, 'TraceDnsResolveHostEndParams'],
+        [ClientSession, SimpleNamespace, 'TraceDnsCacheHitParams'],
+        [ClientSession, SimpleNamespace, 'TraceDnsCacheMissParams'],
+        [ClientSession, SimpleNamespace, 'TraceRequestRedirectParams'],
+        [ClientSession, SimpleNamespace, 'TraceRequestChunkSentParams'],
+        [ClientSession, SimpleNamespace, 'TraceResponseChunkReceivedParams'],
+    ]
+    _Signal = Signal[Callable[_SignalArgs, Awaitable[None]]]
 else:
     _Signal = Signal
 


Test patch:
Repository: aio-libs/aiohttp

Issue:
TooManyRedirects is not properly exposed publicly
## Description

https://github.com/aio-libs/aiohttp/commit/544716cf93b3856e485c8e993de60d9911c002cb (#2943) added `TooManyRedirects` and added it as `aiohttp.TooManyRedirects` [in the documentation](https://docs.aiohttp.org/en/latest/client_reference.html#aiohttp.TooManyRedirects).
However, it's not properly exposed publicly in `__init__.py` and can only be referenced as `aiohttp.client_exceptions.TooManyRedirects`.

## Expected Behaviour

`aiohttp.TooManyRedirects` works, by reference to `aiohttp.client_exceptions.TooManyRedirects`

## Actual Behaviour

`AttributeError: module 'aiohttp' has no attribute 'TooManyRedirects`

## Reproduction Steps

`import aiohttp` and attempt to use `aiohttp.TooManyRedirects`

## Environment

aiohttp 3.5.4
Also reproducible on latest master (https://github.com/aio-libs/aiohttp/commit/81cc715227f6b0f3b36ee6d8bcc95a63a37fbdab)


Discussion:

Resolving patch:
diff --git a/aiohttp/__init__.py b/aiohttp/__init__.py
--- a/aiohttp/__init__.py
+++ b/aiohttp/__init__.py
@@ -30,6 +30,7 @@
     ServerFingerprintMismatch,
     ServerTimeoutError,
     TCPConnector,
+    TooManyRedirects,
     UnixConnector,
     WSServerHandshakeError,
     request,
@@ -127,6 +128,7 @@
     'ServerFingerprintMismatch',
     'ServerTimeoutError',
     'TCPConnector',
+    'TooManyRedirects',
     'UnixConnector',
     'WSServerHandshakeError',
     'request',


Test patch:
Repository: aio-libs/aiohttp

Issue:
TypeError: 'ABCMeta' aiohttp==3.6.0, Python 3.6.9
## Long story short
Cant import aiohttp

pip freeze gives: aiohttp==3.6.0 
python3 version: Python 3.6.9

 import aiohttp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import BaseConnector as BaseConnector
  File "/usr/local/lib/python3.6/site-packages/aiohttp/client.py", line 63, in <module>
    from .client_reqrep import ClientRequest as ClientRequest
  File "/usr/local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 29, in <module>
    from . import hdrs, helpers, http, multipart, payload
  File "/usr/local/lib/python3.6/site-packages/aiohttp/multipart.py", line 703, in <module>
    class MultipartWriter(Payload):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/multipart.py", line 786, in MultipartWriter
    headers: Optional[MultiMapping[str]]=None
TypeError: 'ABCMeta' object is not subscriptable


Any known restriction, what I am missing? 




Discussion:
How did you solved it?
I got the same issue. Any idea about how to solve it?
python 3.7
aiohttp 3.6.0

Anyone has a reproducer? Also, what is the method for aiohttp installation that you use?
For my case, `aiohttp` was installed as a dependency of another python module named `spade`. I used `pip` to install it. The list of all pip packages are as follows:

aiohttp 3.6.0
aiohttp-jinja2 1.1.2
aioopenssl 0.4.1
aiosasl 0.4.0
aioxmpp 0.10.5
arrow 0.15.1
asn1crypto 0.24.0
async-timeout 3.0.1
attrs 19.1.0
Babel 2.7.0
certifi 2019.6.16
cffi 1.12.3
chardet 3.0.4
cryptography 2.7
dnspython 1.16.0
idna 2.8
Jinja2 2.10.1
jinja2-time 0.2.0
lxml 4.4.1
MarkupSafe 1.1.1
multidict 4.4.0
pip 19.2.2
pyasn1 0.4.7
pyasn1-modules 0.2.6
pycparser 2.19
pyOpenSSL 19.0.0
python-dateutil 2.8.0
pytz 2019.2
setuptools 41.0.1
singletonify 0.2.3
six 1.12.0
sortedcollections 1.1.2
sortedcontainers 2.1.0
spade 3.1.3
timeago 1.0.8
tzlocal 1.5.1
wheel 0.33.4
yarl 1.3.0
Try `pip install -U multidict`.
`multidict>=4.5` is required.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -78,7 +78,7 @@ def build_extension(self, ext):
 install_requires = [
     'attrs>=17.3.0',
     'chardet>=2.0,<4.0',
-    'multidict>=4.0,<5.0',
+    'multidict>=4.5,<5.0',
     'async_timeout>=3.0,<4.0',
     'yarl>=1.0,<2.0',
     'idna-ssl>=1.0; python_version<"3.7"',


Test patch:
Repository: aio-libs/aiohttp

Issue:
Fix connection info in ClientConnectorError client exception
The message like `Cannot connect to host www.google.com:443 ssl:None` is misleading.
`ssl:None` means 'default', not 'disabled'

`Cannot connect to host www.google.com:443 ssl:[default]` looks much better


Discussion:

Resolving patch:
diff --git a/aiohttp/client_exceptions.py b/aiohttp/client_exceptions.py
--- a/aiohttp/client_exceptions.py
+++ b/aiohttp/client_exceptions.py
@@ -136,8 +136,9 @@ def ssl(self) -> Union[SSLContext, None, bool, 'Fingerprint']:
         return self._conn_key.ssl
 
     def __str__(self) -> str:
-        return ('Cannot connect to host {0.host}:{0.port} ssl:{0.ssl} [{1}]'
-                .format(self, self.strerror))
+        return ('Cannot connect to host {0.host}:{0.port} ssl:{1} [{2}]'
+                .format(self, self.ssl if self.ssl is not None else 'default',
+                        self.strerror))
 
     # OSError.__reduce__ does too much black magick
     __reduce__ = BaseException.__reduce__


Test patch:
diff --git a/tests/test_client_exceptions.py b/tests/test_client_exceptions.py
--- a/tests/test_client_exceptions.py
+++ b/tests/test_client_exceptions.py
@@ -123,8 +123,8 @@ def test_str(self) -> None:
         err = client.ClientConnectorError(
             connection_key=self.connection_key,
             os_error=OSError(errno.ENOENT, 'No such file'))
-        assert str(err) == ("Cannot connect to host example.com:8080 ssl:None "
-                            "[No such file]")
+        assert str(err) == ("Cannot connect to host example.com:8080 ssl:"
+                            "default [No such file]")
 
 
 class TestClientConnectorCertificateError:
Repository: aio-libs/aiohttp

Issue:
Implement ClientSession.timeout property
It is a bare method that returns `self._timeout`.

Documentation and a simple test are required


Discussion:
Working on providing PR for this issue.

Resolving patch:
diff --git a/aiohttp/client.py b/aiohttp/client.py
--- a/aiohttp/client.py
+++ b/aiohttp/client.py
@@ -913,6 +913,11 @@ def requote_redirect_url(self) -> bool:
         """Do URL requoting on redirection handling."""
         return self._requote_redirect_url
 
+    @property
+    def timeout(self) -> Union[object, ClientTimeout]:
+        """Timeout for the session."""
+        return self._timeout
+
     def detach(self) -> None:
         """Detach connector from session without closing the former.
 


Test patch:
diff --git a/tests/test_client_session.py b/tests/test_client_session.py
--- a/tests/test_client_session.py
+++ b/tests/test_client_session.py
@@ -679,10 +679,13 @@ async def test_client_session_custom_attr() -> None:
         session.custom = None
 
 
-async def test_client_session_timeout_args(loop) -> None:
+async def test_client_session_timeout_default_args(loop) -> None:
     session1 = ClientSession()
-    assert session1._timeout == client.DEFAULT_TIMEOUT
+    assert session1.timeout == client.DEFAULT_TIMEOUT
 
+async def test_client_session_timeout_argument() -> None:
+    session = ClientSession(timeout=500)
+    assert session.timeout == 500
 
 async def test_requote_redirect_url_default() -> None:
     session = ClientSession()
Repository: aio-libs/aiohttp

Issue:
The definition of LooseCookies is too narrow
Seems both `CookieJar.update_cookies()` and `ClientRequest.update_cookies()` accept also `Iterable[Tuple[str, Union[Morsel, str]]` and `Mapping[str, Union[Morsel, str]]`.

The definition of `LooseCookies` which does not include the above types is not compatible with existing user code.


Discussion:
Agree. Good first-time issue.
Any volunteer?
Hey! Can I work on this? What is to be done exactly?

Resolving patch:
diff --git a/aiohttp/cookiejar.py b/aiohttp/cookiejar.py
--- a/aiohttp/cookiejar.py
+++ b/aiohttp/cookiejar.py
@@ -124,7 +124,7 @@ def update_cookies(self,
             return
 
         if isinstance(cookies, Mapping):
-            cookies = cookies.items()  # type: ignore
+            cookies = cookies.items()
 
         for name, cookie in cookies:
             if not isinstance(cookie, Morsel):
diff --git a/aiohttp/typedefs.py b/aiohttp/typedefs.py
--- a/aiohttp/typedefs.py
+++ b/aiohttp/typedefs.py
@@ -29,7 +29,7 @@
     _CIMultiDictProxy = CIMultiDictProxy[str]
     _MultiDict = MultiDict[str]
     _MultiDictProxy = MultiDictProxy[str]
-    from http.cookies import BaseCookie  # noqa
+    from http.cookies import BaseCookie, Morsel  # noqa
 else:
     _CIMultiDict = CIMultiDict
     _CIMultiDictProxy = CIMultiDictProxy
@@ -43,8 +43,18 @@
                      _CIMultiDictProxy]
 RawHeaders = Tuple[Tuple[bytes, bytes], ...]
 StrOrURL = Union[str, URL]
-LooseCookies = Union[Iterable[Tuple[str, 'BaseCookie[str]']],
-                     Mapping[str, 'BaseCookie[str]'], 'BaseCookie[str]']
+
+StrBaseCookieTuples = Iterable[Tuple[str, 'BaseCookie[str]']]
+StrMorselTuples = Iterable[Tuple[str, 'Morsel[str]']]
+StrToBaseCookieMapping = Mapping[str, 'BaseCookie[str]']
+StrToMorselMapping = Mapping[str, 'Morsel[Any]']
+LooseCookies = Union[
+    StrBaseCookieTuples,
+    StrMorselTuples,
+    StrToBaseCookieMapping,
+    StrToMorselMapping,
+    'BaseCookie[str]',
+]
 
 
 if sys.version_info >= (3, 6):


Test patch:
Repository: aio-libs/aiohttp

Issue:
Contradiction between documentation and annotation of the secure parameter of set_cookie()
The `secure` parameter of `StreamResponse.set_cookie()` is [documented](https://docs.aiohttp.org/en/stable/web_reference.html#aiohttp.web.StreamResponse.set_cookie) as `bool`, but is [annotated](https://github.com/aio-libs/aiohttp/blob/62365364889981a2e5d3cd36a25240c9c38693fe/aiohttp/web_response.py#L172) as `Optional[str]`.

What is right?



Discussion:
There is #3836
Since https://github.com/python/typeshed/issues/3059 is fixed and new mypy is released we need to update `set_cookie` annotation.
#3836 does not touch the `secure` parameter.

Resolving patch:
diff --git a/aiohttp/web_response.py b/aiohttp/web_response.py
--- a/aiohttp/web_response.py
+++ b/aiohttp/web_response.py
@@ -169,8 +169,8 @@ def set_cookie(self, name: str, value: str, *,
                    domain: Optional[str]=None,
                    max_age: Optional[Union[int, str]]=None,
                    path: str='/',
-                   secure: Optional[str]=None,
-                   httponly: Optional[str]=None,
+                   secure: Optional[bool]=None,
+                   httponly: Optional[bool]=None,
                    version: Optional[str]=None) -> None:
         """Set or update response cookie.
 


Test patch:
Repository: aio-libs/aiohttp

Issue:
TCPConnector ttl_dns_cache type hint
Hello,

```
class TCPConnector
def __init__(
....
ttl_dns_cache: int=10
...)
```

but documentation (and code so):

> ttl_dns_cache (int) –
> 
> expire after some seconds the DNS entries, None means cached forever. By default 10 seconds.

Can you annotate as Optional[int], please?


Discussion:
Pull Request is welcome!
Can I take this?

Resolving patch:
diff --git a/aiohttp/connector.py b/aiohttp/connector.py
--- a/aiohttp/connector.py
+++ b/aiohttp/connector.py
@@ -695,7 +695,7 @@ class TCPConnector(BaseConnector):
     """
 
     def __init__(self, *,
-                 use_dns_cache: bool=True, ttl_dns_cache: int=10,
+                 use_dns_cache: bool=True, ttl_dns_cache: Optional[int]=10,
                  family: int=0,
                  ssl: Union[None, bool, Fingerprint, SSLContext]=None,
                  local_addr: Optional[Tuple[str, int]]=None,


Test patch: