forked from VimPlug/jedi
Get a first typing test with Sequence[int] working
This means basically that annotations are working at least in some way and Generic classes as well.
This commit is contained in:
@@ -123,12 +123,18 @@ class FunctionContext(use_metaclass(CachedMetaClass, AbstractFunction)):
|
||||
def py__class__(self):
|
||||
return compiled.get_special_object(self.evaluator, u'FUNCTION_CLASS')
|
||||
|
||||
def get_default_param_context(self):
|
||||
return self.parent_context
|
||||
|
||||
|
||||
class MethodContext(FunctionContext):
|
||||
def __init__(self, evaluator, class_context, *args, **kwargs):
|
||||
super(MethodContext, self).__init__(evaluator, *args, **kwargs)
|
||||
self.class_context = class_context
|
||||
|
||||
def get_default_param_context(self):
|
||||
return self.class_context
|
||||
|
||||
|
||||
class FunctionExecutionContext(TreeContext):
|
||||
"""
|
||||
@@ -192,11 +198,6 @@ class FunctionExecutionContext(TreeContext):
|
||||
break
|
||||
return context_set
|
||||
|
||||
def get_default_param_context(self):
|
||||
if isinstance(self.function_context, MethodContext):
|
||||
return self.function_context.class_context
|
||||
return self.parent_context
|
||||
|
||||
def _get_yield_lazy_context(self, yield_expr):
|
||||
if yield_expr.type == 'keyword':
|
||||
# `yield` just yields None.
|
||||
|
||||
Reference in New Issue
Block a user