diff --git a/jedi/inference/compiled/value.py b/jedi/inference/compiled/value.py index e493750f..7458ae40 100644 --- a/jedi/inference/compiled/value.py +++ b/jedi/inference/compiled/value.py @@ -264,6 +264,12 @@ class CompiledObject(Value): self.access_handle.execute_operation(other.access_handle, operator) ) + def execute_annotation(self): + if self.access_handle.get_repr() == 'None': + # None as an annotation doesn't need to be executed. + return ValueSet([self]) + return super().execute_annotation() + def negate(self): return create_from_access_path(self.inference_state, self.access_handle.negate()) diff --git a/jedi/third_party/typeshed b/jedi/third_party/typeshed index 3319cadf..ff92f09e 160000 --- a/jedi/third_party/typeshed +++ b/jedi/third_party/typeshed @@ -1 +1 @@ -Subproject commit 3319cadf85012328f8a12b15da4eecc8de0cf305 +Subproject commit ff92f09efbe9c7d67ca13d30ca56c4afbe13f129 diff --git a/test/completion/pep0484_basic.py b/test/completion/pep0484_basic.py index ba7cab18..6c89c738 100644 --- a/test/completion/pep0484_basic.py +++ b/test/completion/pep0484_basic.py @@ -44,7 +44,7 @@ def return_none() -> None: """ pass -#? +#? None return_none() diff --git a/test/completion/pep0484_typing.py b/test/completion/pep0484_typing.py index ae49d10d..9d2cbd83 100644 --- a/test/completion/pep0484_typing.py +++ b/test/completion/pep0484_typing.py @@ -214,7 +214,7 @@ def union(p, q, r, s, t): r #? int() str() float() dict() s - #? int() + #? int() None t def optional(p): diff --git a/test/test_api/test_signatures.py b/test/test_api/test_signatures.py index 7264cee3..8b4044ec 100644 --- a/test/test_api/test_signatures.py +++ b/test/test_api/test_signatures.py @@ -71,4 +71,4 @@ def test_param_kind_and_name(code, index, param_code, kind, Script, skip_python2 def test_staticmethod(Script): s, = Script('staticmethod(').call_signatures() - assert s.to_string() == 'staticmethod(f: Callable)' + assert s.to_string() == 'staticmethod(f: Callable[..., Any])' diff --git a/test/test_inference/test_gradual/test_typeshed.py b/test/test_inference/test_gradual/test_typeshed.py index 4a30cb51..8b7285de 100644 --- a/test/test_inference/test_gradual/test_typeshed.py +++ b/test/test_inference/test_gradual/test_typeshed.py @@ -27,13 +27,13 @@ def test_get_typeshed_directories(): assert dirs == transform({'stdlib/2and3', 'stdlib/3', 'third_party/2and3', 'third_party/3'}) dirs = get_dirs(PythonVersionInfo(3, 5)) - assert dirs == transform({'stdlib/2and3', 'stdlib/3', 'stdlib/3.5', - 'third_party/2and3', 'third_party/3', 'third_party/3.5'}) + assert dirs == transform({'stdlib/2and3', 'stdlib/3', + 'third_party/2and3', 'third_party/3'}) dirs = get_dirs(PythonVersionInfo(3, 6)) - assert dirs == transform({'stdlib/2and3', 'stdlib/3', 'stdlib/3.5', + assert dirs == transform({'stdlib/2and3', 'stdlib/3', 'stdlib/3.6', 'third_party/2and3', - 'third_party/3', 'third_party/3.5', 'third_party/3.6'}) + 'third_party/3', 'third_party/3.6'}) def test_get_stub_files():