In python-3.5 , you can use iterative unpacking:
call_function([*a_list, *iter(b_list)])
This works with:
>>> [*a_list, *iter(b_list)]
[1, 2, 3, 4, 5]
Note the asterisk ( *) in front of a_listand iter(b_list). Moreover, it a_listshould only be a finite iterative iterator. That way, you can simply create a list that combines the final iterations together.
source
share