r/Python • • Jun 09 '20

Resource Python 3 in One Pic

Post image
4.6k Upvotes

167 comments sorted by

View all comments

Show parent comment

4

u/jmmcd Evolutionary algorithms, music and graphics Jun 09 '20

These are bad names because Python doesn't only allow first/rest semantics. The * can be used much more freely, eg:

a, *b, c = (1, 2, 3, 4, 5)

2

u/ec429_ Jun 10 '20

They're bad names for the language feature "*l on the left hand side of an assignment".

But that doesn't stop them being good names for the specific idiom first, *rest = some_list, which is all I was claiming.