Changeset 388 for python/vendor/current/Tools/compiler
- Timestamp:
- Mar 19, 2014, 11:11:30 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/vendor/current/Tools/compiler/astgen.py
r2 r388 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.