@@ -174,7 +174,8 @@ def make_name_ref(cls, arg: NameDef) -> 'NameRef':
174
174
def make_getattr (cls , lhs : 'Expr' , name : Text ) -> 'Expr' :
175
175
return cls (ExprKind .GETATTR , (lhs ,), str_payload = name )
176
176
177
- def __init__ (self , kind : ExprKind , operands : Tuple ['Expr' , ...], str_payload : Optional [str ] = None ):
177
+ def __init__ (self , kind : ExprKind , operands : Tuple ['Expr' , ...],
178
+ str_payload : Optional [str ] = None ):
178
179
assert isinstance (operands , tuple ), operands
179
180
self .kind = kind
180
181
self .operands = operands
@@ -189,15 +190,14 @@ def _format(self) -> Text:
189
190
if self .kind == ExprKind .NONE_LITERAL :
190
191
return 'None'
191
192
if self .kind == ExprKind .STR_LITERAL :
192
- return repr (self .operands [ 0 ] )
193
+ return repr (self .str_payload )
193
194
if self .kind == ExprKind .INVOKE :
194
- lhs , args = self .operands
195
- assert isinstance (args , tuple ), args
195
+ lhs , * args = self .operands
196
196
return '{}({})' .format (
197
197
lhs .format (), ', ' .join (a .format () for a in args ))
198
198
if self .kind == ExprKind .GETATTR :
199
199
return '({}).{}' .format (self .operands [0 ].format (),
200
- self .operands [ 1 ] )
200
+ self .str_payload )
201
201
raise NotImplementedError (self )
202
202
203
203
def format (self , indent : int = 0 ) -> Text :
0 commit comments