Add a execute_annotation option to infer_annotation
This commit is contained in:
1 parent
375d1d57fb
commit
24db05841b
3 files changed
+26
-13
No files matched your search
@@ -220,11 +220,14 @@ class ParamName(BaseTreeParamName):
|
||||
def annotation_node(self):
|
||||
return self._get_param_node().annotation
|
||||
|
||||
def infer_annotation(self):
|
||||
def infer_annotation(self, execute_annotation=True):
|
||||
node = self.annotation_node
|
||||
if node is None:
|
||||
return NO_CONTEXTS
|
||||
return self.parent_context.parent_context.eval_node(node)
|
||||
contexts = self.parent_context.parent_context.eval_node(node)
|
||||
if execute_annotation:
|
||||
contexts = contexts.execute_annotation()
|
||||
return contexts
|
||||
|
||||
def infer_default(self):
|
||||
node = self.default_node
|
||||
|
||||
Reference in new issue
Block a user