diff --git a/uncompyle6/parsers/parse3.py b/uncompyle6/parsers/parse3.py index a2262470..727786d7 100644 --- a/uncompyle6/parsers/parse3.py +++ b/uncompyle6/parsers/parse3.py @@ -282,8 +282,7 @@ class Python3Parser(PythonParser): # int, float, str annotate_arg ::= LOAD_NAME # LOAD_CONST is used in an annotation string - annotate_arg ::= LOAD_CONST - annotate_arg ::= LOAD_GLOBAL + annotate_arg ::= expr # This stores the tuple of parameter names # that have been annotated diff --git a/uncompyle6/semantics/make_function.py b/uncompyle6/semantics/make_function.py index 0b545426..6b3ea5ad 100644 --- a/uncompyle6/semantics/make_function.py +++ b/uncompyle6/semantics/make_function.py @@ -97,8 +97,7 @@ def make_function3_annotate(self, node, isLambda, nested=1, j = annotate_last-1 l = -len(node) while j >= l and node[j].type in ('annotate_arg' 'annotate_tuple'): - annotate_args[annotate_tup[i]] = (node[j][0].attr, - node[j][0] in ('LOAD_CONST', 'LOAD_GLOBAL')) + annotate_args[annotate_tup[i]] = node[j][0] i -= 1 j -= 1 @@ -227,14 +226,11 @@ def make_function3_annotate(self, node, isLambda, nested=1, self.write(', ') i += 1 pass - elif n == 'annotate_arg': - from trepan.api import debug; debug() - pass pass annotate_args = [] for n in node: if n == 'annotate_arg': - annotate_args.append(n[0].attr) + annotate_args.append(n[0]) elif n == 'annotate_tuple': t = n[0].attr if t[-1] == 'return': @@ -243,7 +239,8 @@ def make_function3_annotate(self, node, isLambda, nested=1, pass last = len(annotate_args) - 1 for i in range(len(annotate_args)): - self.write("%s: %s" % (annotate_args[i], t[i])) + self.write("%s: " % (t[i])) + self.preorder(annotate_args[i]) if i < last: self.write(', ') pass