Re:Python idiom for taking the single item from a list
by StavrosK on Monday September 27, 2010 @02:30PM
(#1732771)
I 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...
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]