Message255971
random.shuffle operates on a list, and changes it in place. I think returning a reference to this list, the same one we got in as the argument, is quite useful and makes it possible to use random.shuffle in chained function calls, e.g.:
somelist.append(''.join(shuffle(list('hello'))))
[i for i in shuffle(list(range(10))) if i%2]
I don't see any good arguments against this, and I couldn't think of a reasonable test for this — is it necessary to test whether the returned reference is the same as the one passed in?
I'm open to any discussion or suggestions you might have. |
|
Date |
User |
Action |
Args |
2015-12-05 20:34:19 | Eugene Yunak | set | recipients:
+ Eugene Yunak |
2015-12-05 20:34:19 | Eugene Yunak | set | messageid: <1449347659.07.0.0890236268901.issue25811@psf.upfronthosting.co.za> |
2015-12-05 20:34:19 | Eugene Yunak | link | issue25811 messages |
2015-12-05 20:34:18 | Eugene Yunak | create | |
|