# HG changeset patch # User Paul Boddie # Date 1381274882 -7200 # Node ID d61b41b5311eea3c205be2712560c01109df34b6 # Parent a6777234627222ff8e78b7a467196e28be450b1f Added the unit annotation for all attribute users. diff -r a67772346272 -r d61b41b5311e 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) @@ -1487,10 +1485,6 @@ self.node = node self.lineno = lineno - # Additional annotations. - - self.unit = None - def getChildren(self): return self.doc, self.node