Devin Jeanpierre wrote:
On Wed, Feb 4, 2015 at 1:18 PM, Chris Angelico <[email protected]> wrote:
On Thu, Feb 5, 2015 at 4:36 AM, Peter Otten <[email protected]> wrote:
[result] = f()
result
Huh, was not aware of that alternate syntax.
Nor are most people. Nor is Python, in some places -- it seems like
people forgot about it when writing some bits of the grammar.
If I remember correctly, it's left over from long ago
when you had to use tuple syntax to unpack tuples and
list syntax to unpack lists (and you couldn't unpack
anything else).
When the iterator protocol was introduced, the two
became equivalent.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list