20 Apr
2020
20 Apr
'20
3:58 p.m.
On 20/04/2020 16:25, J. Pic wrote:
Hi all,
Currently, list.append(x) mutates the list and returns None.
It would be a little syntactic sugar to return x, for example:
something = mylist.append(Something())
What do you think ?
I'm generally opposed to trying to do too many things on one line; the more you pile in, the more chance it will be misunderstood. In this case, why would the average naive user expect that your new Something is what's going to be returned? The usual request is to have (the mutated) `mylist` returned (which we don't do for reasons), and that's what people are going to expect. -- Rhodri James *-* Kynesim Ltd