From 095f1295af8e90e1e7501f20b275ca1da164a55e Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 11 Jan 2020 21:35:18 +0100 Subject: [PATCH] Avoid a bug that a compiler might have found, fixes #1469 --- jedi/inference/gradual/typing.py | 1 - test/completion/pep0484_typing.py | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/jedi/inference/gradual/typing.py b/jedi/inference/gradual/typing.py index cfdce3ea..3b3cdf17 100644 --- a/jedi/inference/gradual/typing.py +++ b/jedi/inference/gradual/typing.py @@ -142,7 +142,6 @@ class TypingValueWithIndex(BaseTypingValueWithGenerics): class ProxyTypingValue(BaseTypingValue): index_class = TypingValueWithIndex - py__simple_getitem__ = None def with_generics(self, generics_tuple): return self.index_class.create_cached( diff --git a/test/completion/pep0484_typing.py b/test/completion/pep0484_typing.py index 32d00932..9104ca11 100644 --- a/test/completion/pep0484_typing.py +++ b/test/completion/pep0484_typing.py @@ -332,6 +332,9 @@ def union4(x: U[int, str]): #? int() str() x +#? typing.Optional +typing.Optional[0] + # ------------------------- # Type Vars # -------------------------