File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ test: mypy check
3
3
4
4
5
5
mypy :
6
- mypy async_timeout tests
6
+ mypy --config-file setup.cfg async_timeout tests
7
7
8
8
9
9
check :
Original file line number Diff line number Diff line change 2
2
import sys
3
3
4
4
from types import TracebackType
5
- from typing import Optional , Type
5
+ from typing import Optional , Type , Any
6
6
7
7
8
8
__version__ = '3.0.0'
@@ -25,12 +25,12 @@ class timeout:
25
25
loop - asyncio compatible event loop
26
26
"""
27
27
def __init__ (self , timeout : Optional [float ],
28
- * , loop : asyncio .AbstractEventLoop = None ) -> None :
28
+ * , loop : Optional [ asyncio .AbstractEventLoop ] = None ) -> None :
29
29
self ._timeout = timeout
30
30
if loop is None :
31
31
loop = asyncio .get_event_loop ()
32
32
self ._loop = loop
33
- self ._task = None # type: Optional[asyncio.Task]
33
+ self ._task = None # type: Optional[asyncio.Task[Any] ]
34
34
self ._cancelled = False
35
35
self ._cancel_handler = None # type: Optional[asyncio.Handle]
36
36
self ._cancel_at = None # type: Optional[float]
@@ -102,7 +102,7 @@ def _cancel_task(self) -> None:
102
102
self ._cancelled = True
103
103
104
104
105
- def current_task (loop : asyncio .AbstractEventLoop ) -> asyncio .Task :
105
+ def current_task (loop : asyncio .AbstractEventLoop ) -> ' asyncio.Task[Any]' :
106
106
if PY_37 :
107
107
task = asyncio .current_task (loop = loop ) # type: ignore
108
108
else :
Original file line number Diff line number Diff line change @@ -6,3 +6,16 @@ license_file = LICENSE
6
6
7
7
[mypy-pytest]
8
8
ignore_missing_imports = true
9
+
10
+ [mypy]
11
+ python_version = 3.6
12
+ warn_unused_ignores = True
13
+ warn_redundant_casts = True
14
+ warn_no_return = True
15
+ strict_optional = True
16
+ show_traceback = True
17
+ show_column_numbers = True
18
+ no_implicit_optional = True
19
+ disallow_incomplete_defs = True
20
+ disallow_any_generics = True
21
+ ignore_missing_imports = True
You can’t perform that action at this time.
0 commit comments