[issue25811] return from random.shuffle

2015-12-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Agreed with all Emanuel has said. -- nosy: +serhiy.storchaka resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

[issue25811] return from random.shuffle

2015-12-05 Thread Eugene Yunak
New submission from Eugene Yunak: 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.:

[issue25811] return from random.shuffle

2015-12-05 Thread Emanuel Barry
Emanuel Barry added the comment: While I do see the desire to get your list back for such cases (I would have liked so, too, in some cases), it's inconsistent, as everything else operating in-place returns None. Plus, having it return None helps you remember that you should keep the