mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
Add explicit Optional annotation
This isn't a mypy issue -- there's no way it could otherwise know that this `None` value is in fact an optional callable.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
|
from typing import Callable, Optional
|
||||||
|
|
||||||
_inited = False
|
_inited = False
|
||||||
|
|
||||||
@@ -62,7 +63,7 @@ enable_warning = False
|
|||||||
enable_notice = False
|
enable_notice = False
|
||||||
|
|
||||||
# callback, interface: level, str
|
# callback, interface: level, str
|
||||||
debug_function = None
|
debug_function: Optional[Callable[[str, str], None]] = None
|
||||||
_debug_indent = 0
|
_debug_indent = 0
|
||||||
_start_time = time.time()
|
_start_time = time.time()
|
||||||
|
|
||||||
|
|||||||
@@ -57,8 +57,3 @@ strict_equality = True
|
|||||||
[mypy-jedi,jedi.inference.compiled,jedi.inference.value]
|
[mypy-jedi,jedi.inference.compiled,jedi.inference.value]
|
||||||
# Various __init__.py files which contain re-exports we want to implicitly make.
|
# Various __init__.py files which contain re-exports we want to implicitly make.
|
||||||
implicit_reexport = True
|
implicit_reexport = True
|
||||||
|
|
||||||
[mypy-jedi.debug]
|
|
||||||
# jedi.debug is configured by setting module-level values, which mypy doesn't
|
|
||||||
# know about. See https://github.com/python/mypy/issues/9209.
|
|
||||||
warn_unreachable = False
|
|
||||||
|
|||||||
Reference in New Issue
Block a user