Last Updated: February 25, 2016
·
431
· mejarc

Parallel assignment and that comma

These have different results:

first_thing, = ["foo", "bar"]  # first_thing is a String, "foo"

first_thing = ["foo", "bar"]  # first_thing is the Array ["foo", "bar"]

The first statement can be more verbose:

first_thing, * = ["foo", "bar", "baz"]