This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Eugene Yunak
Recipients Eugene Yunak
Date 2015-12-05.20:34:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1449347659.07.0.0890236268901.issue25811@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-12-05 20:34:19Eugene Yunaksetrecipients: + Eugene Yunak
2015-12-05 20:34:19Eugene Yunaksetmessageid: <1449347659.07.0.0890236268901.issue25811@psf.upfronthosting.co.za>
2015-12-05 20:34:19Eugene Yunaklinkissue25811 messages
2015-12-05 20:34:18Eugene Yunakcreate