3 ms·
The brackets are optional; you can also write thing, = [stuff] though some people think that it's less legible since it has a completely different meaning wit
by mikeklaas 16y ago
The brackets are optional; you can also write
thing, = [stuff]
though some people think that it's less legible since it has a completely different meaning without the comma.
EDIT: you can even play with the whitespace and pretend that ",=" is a list->scalar conversion operator:
x ,= [1]
- StavrosK 16y agoI know about the optional parentheses, but omitting them makes the comma very easy to overlook :/ I do like your fake operator idea, but it seems that it would go against the spirit of python and make it easier at the expense of readability...