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:
Dave Halter
2018-08-27 23:24:46 +02:00
parent 7c8051feab
commit e74d4fe9b7
3 changed files with 18 additions and 14 deletions
+5 -4
View File
@@ -168,10 +168,11 @@ def infer_param(execution_context, param):
param_comment = params_comments[index]
return _evaluate_annotation_string(
execution_context.get_root_context(),
execution_context.function_context.get_default_param_context(),
param_comment
)
module_context = execution_context.get_root_context()
# Annotations are like default params and resolve in the same way.
module_context = execution_context.function_context.get_default_param_context()
return _evaluate_for_annotation(module_context, annotation)
@@ -207,11 +208,11 @@ def infer_return_types(function_context):
return NO_CONTEXTS
return _evaluate_annotation_string(
function_context.get_root_context(),
function_context.get_default_param_context(),
match.group(1).strip()
)
module_context = function_context.get_root_context()
module_context = function_context.get_default_param_context()
return _evaluate_for_annotation(module_context, annotation)