@@ -147,7 +147,7 @@ def extract_callback_args(args, kwargs, name, type_):
147
147
def handle_callback_args (args , kwargs ):
148
148
"""Split args into outputs, inputs and states"""
149
149
prevent_initial_call = kwargs .get ("prevent_initial_call" , None )
150
- if prevent_initial_call is None and len ( args ) and isinstance (args [- 1 ], bool ):
150
+ if prevent_initial_call is None and args and isinstance (args [- 1 ], bool ):
151
151
prevent_initial_call = args .pop ()
152
152
153
153
# flatten args, to support the older syntax where outputs, inputs, and states
@@ -158,7 +158,7 @@ def handle_callback_args(args, kwargs):
158
158
159
159
outputs = extract_callback_args (flat_args , kwargs , "output" , Output )
160
160
if len (outputs ) == 1 :
161
- out0 = kwargs .get ("output" , args [0 ] if len ( args ) else None )
161
+ out0 = kwargs .get ("output" , args [0 ] if args else None )
162
162
if not isinstance (out0 , (list , tuple )):
163
163
outputs = outputs [0 ]
164
164
@@ -171,9 +171,5 @@ def handle_callback_args(args, kwargs):
171
171
"then all Inputs, then all States. Trailing this we found:\n "
172
172
+ repr (flat_args )
173
173
)
174
- return [
175
- outputs ,
176
- inputs ,
177
- states ,
178
- prevent_initial_call ,
179
- ]
174
+
175
+ return outputs , inputs , states , prevent_initial_call
0 commit comments