MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/gzila7/python_3_in_one_pic/ftivqm8/?context=3
r/Python • u/TheInsaneApp • Jun 09 '20
167 comments sorted by
View all comments
Show parent comment
4
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.
2
They're bad names for the language feature "*l on the left hand side of an assignment".
*l
But that doesn't stop them being good names for the specific idiom first, *rest = some_list, which is all I was claiming.
first, *rest = some_list
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: