Changeset 391 for python/trunk/Tools/compiler/astgen.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Tools/compiler/astgen.py
r2 r391 106 106 def _gen_init(self, buf): 107 107 if self.args: 108 print >> buf, " def __init__(self, %s, lineno=None):" % self.args 108 argtuple = '(' in self.args 109 args = self.args if not argtuple else ''.join(self.argnames) 110 print >> buf, " def __init__(self, %s, lineno=None):" % args 109 111 else: 110 112 print >> buf, " def __init__(self, lineno=None):" 111 113 if self.argnames: 112 for name in self.argnames: 113 print >> buf, " self.%s = %s" % (name, name) 114 if argtuple: 115 for idx, name in enumerate(self.argnames): 116 print >> buf, " self.%s = %s[%s]" % (name, args, idx) 117 else: 118 for name in self.argnames: 119 print >> buf, " self.%s = %s" % (name, name) 114 120 print >> buf, " self.lineno = lineno" 115 121 # Copy the lines in self.init, indented four spaces. The rstrip()
Note:
See TracChangeset
for help on using the changeset viewer.