forked from VimPlug/jedi
Introduce some stricter typing
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
This module is about generics, like the `int` in `List[int]`. It's not about
|
||||
the Generic class.
|
||||
"""
|
||||
from abc import abstractmethod
|
||||
|
||||
from jedi import debug
|
||||
from jedi.cache import memoize_method
|
||||
@@ -24,6 +25,14 @@ def _resolve_forward_references(context, value_set):
|
||||
|
||||
|
||||
class _AbstractGenericManager:
|
||||
@abstractmethod
|
||||
def __getitem__(self, index):
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
def to_tuple(self):
|
||||
raise NotImplementedError
|
||||
|
||||
def get_index_and_execute(self, index):
|
||||
try:
|
||||
return self[index].execute_annotation()
|
||||
|
||||
@@ -6,6 +6,7 @@ values.
|
||||
This file deals with all the typing.py cases.
|
||||
"""
|
||||
import itertools
|
||||
from typing import Any
|
||||
|
||||
from jedi import debug
|
||||
from jedi.inference.compiled import builtin_from_name, create_simple_object
|
||||
@@ -186,6 +187,8 @@ class ProxyTypingValue(BaseTypingValue):
|
||||
|
||||
|
||||
class _TypingClassMixin(ClassMixin):
|
||||
_tree_name: Any
|
||||
|
||||
def py__bases__(self):
|
||||
return [LazyKnownValues(
|
||||
self.inference_state.builtins_module.py__getattribute__('object')
|
||||
|
||||
Reference in New Issue
Block a user