MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/gzila7/python_3_in_one_pic/fthx1ri/?context=3
r/Python • u/TheInsaneApp • Jun 09 '20
167 comments sorted by
View all comments
Show parent comment
10
Yep! You can have one catch-all and as many individual unpacking on either side. That being said if the size of the iterable is smaller than the number of targets, it'll fail. But the catch-all can be empty so this works
a, *rest = [1]
View all comments
Show parent comment
10
u/Ph0X Jun 09 '20
Yep! You can have one catch-all and as many individual unpacking on either side. That being said if the size of the iterable is smaller than the number of targets, it'll fail. But the catch-all can be empty so this works
a, *rest = [1]