# HG changeset patch # User Paul Boddie # Date 1381274882 -7200 # Node ID 714bdce33f30e5a43a54b7cdabfcfa38a98b535c # Parent cf77f68dff0a6b376ab0ed310fab7f601cfe845f Added the unit annotation for all attribute users. diff -r cf77f68dff0a -r 714bdce33f30 compiler/ast.py --- a/compiler/ast.py Sun Jun 30 22:42:16 2013 +0200 +++ b/compiler/ast.py Wed Oct 09 01:28:02 2013 +0200 @@ -74,6 +74,7 @@ "Annotation-related node." def __init__(self): + self.unit = None # Name and usage observations. @@ -543,7 +544,12 @@ return tuple(nodelist) def __repr__(self): - return "CallFunc(%r, %r, %r, %r)" % (self.node, self.args, self.star_args, self.dstar_args) + args = [] + if self.dstar_args: + args.insert(0, repr(self.dstar_args)) + if args or self.star_args: + args.insert(0, repr(self.star_args)) + return "CallFunc(%r, %r%s)" % (self.node, self.args, args and (", %s" % ", ".join(args)) or "") def __str__(self): star_args = self.star_args and ["*%s" % self.star_args] or [] @@ -563,10 +569,6 @@ self.decorators = decorators self.lineno = lineno - # Additional annotations. - - self.unit = None - def getChildren(self): children = [] children.append(self.name) @@ -916,10 +918,6 @@ if flags & CO_VARKEYWORDS: self.kwargs = 1 - # Additional annotations. - - self.unit = None - def getChildren(self): children = [] children.append(self.decorators) @@ -1430,10 +1428,6 @@ self.node = node self.lineno = lineno - # Additional annotations. - - self.unit = None - def getChildren(self): return self.doc, self.node