On 8 September 2016 at 10:34, Arek Bulski email@example.com wrote:
That wont work because I would have to type the expression that is used as argument twice in a test. I need shuffled. Enough said.
You've probably spent way more time debating shuffled here than you would have needed to add a shuffled function to your test file.
Your justification for the amount of time you've spent here, and that you've persuaded others to spend (and are further asking to be spent on maintenance) *has* to be more significant than "I needed shuffled() for this one specific case". But it's hard to understand what the *general* use cases you've (presumably) identified are - everyone responding has been saying "but I don't personally have a use for this". So in order to warrant the addition of a function to the stdlib, you need to explain what benefits justify the cost - and you simply haven't done that. The one case you've stated could have been solved in 2 minutes by writing a one-off function. And no-one has said "now that you mention it, I find the problem you had comes up a lot", so we're still at the position where it's a specialised use.
The cost is non-trivial. Implementation is a relatively small cost, design is slightly higher (see for example Nick's point that this should be a method on the random instance as well as a module-level function), documentation and tests need to be added, 3rd party training material needs to be updated, bug reports need to be managed and resolved, etc. The benefit? I'm not clear, beyond you not needing to write a custom function in your test suite, and a couple of people who weren't aware they could use PYTHONSTARTUP to add their own personal functions being less frustrated by how random.shuffle behaves. And some theoretical "people might find this useful" comments that no-one has backed up with code samples.
Nick contributed some suggestions in terms of benefits around teachability, and the improved design noted above. But the point here is that you shouldn't expect others to justify your proposal for you - you need to justify it yourself, or be prepared to accept "we don't see the benefit" as a response.