mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Generate correct reprs for Mul, Add, etc.
This commit is contained in:
parent
ec5bfd13ca
commit
ab427b8cce
4 changed files with 20 additions and 40 deletions
|
@ -81,6 +81,8 @@ class NodeInfo:
|
|||
print >> buf, " def __repr__(self):"
|
||||
if self.argnames:
|
||||
fmt = COMMA.join(["%s"] * self.nargs)
|
||||
if '(' in self.args:
|
||||
fmt = '(%s)' % fmt
|
||||
vals = ["repr(self.%s)" % name for name in self.argnames]
|
||||
vals = COMMA.join(vals)
|
||||
if self.nargs == 1:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue