Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 3
    But this might take more memory! Commented Feb 28, 2019 at 4:42
  • I do not see the point of the starred placeholder given that Python will check the number of values to unpack (so it will do the counting for you). Commented Sep 16, 2019 at 13:48
  • 1
    @GabrielDevillers, I think Python will raise an exception if there is a mismatch on number of elements in the tuple to assign. Commented Sep 16, 2019 at 21:18
  • 1
    Indeed, it does in my test (Python2,3) but that means that any counting mistake from the programmer will be catched on first test (with a message giving the correct count). Commented Sep 16, 2019 at 22:29