mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
Fix type var completions so that there's at least no error
This commit is contained in:
@@ -322,7 +322,7 @@ class Protocol(_ContainerBase):
|
|||||||
|
|
||||||
class Any(_BaseTypingContext):
|
class Any(_BaseTypingContext):
|
||||||
def execute_annotation(self):
|
def execute_annotation(self):
|
||||||
debug.warning('Used Any, which is not implemented, yet.')
|
debug.warning('Used Any - returned no results')
|
||||||
return NO_CONTEXTS
|
return NO_CONTEXTS
|
||||||
|
|
||||||
|
|
||||||
@@ -390,6 +390,9 @@ class TypeVar(Context):
|
|||||||
else:
|
else:
|
||||||
debug.warning('Invalid TypeVar param name %s', key)
|
debug.warning('Invalid TypeVar param name %s', key)
|
||||||
|
|
||||||
|
def get_filters(self, *args, **kwargs):
|
||||||
|
return iter([])
|
||||||
|
|
||||||
def execute_annotation(self):
|
def execute_annotation(self):
|
||||||
if self._bound_lazy_context is not None:
|
if self._bound_lazy_context is not None:
|
||||||
return self._bound_lazy_context.infer().execute_annotation()
|
return self._bound_lazy_context.infer().execute_annotation()
|
||||||
|
|||||||
@@ -308,7 +308,9 @@ def union4(x: U[int, str]):
|
|||||||
|
|
||||||
|
|
||||||
TYPE_VAR = typing.TypeVar('TYPE_VAR')
|
TYPE_VAR = typing.TypeVar('TYPE_VAR')
|
||||||
|
# TODO there should at least be some results.
|
||||||
|
#? []
|
||||||
|
TYPE_VAR.
|
||||||
|
|
||||||
class WithTypeVar(typing.Generic[TYPE_VAR]):
|
class WithTypeVar(typing.Generic[TYPE_VAR]):
|
||||||
def lala(self) -> TYPE_VAR:
|
def lala(self) -> TYPE_VAR:
|
||||||
|
|||||||
Reference in New Issue
Block a user