But would you _use_ it? I'm still asking for use cases.
When, e.g., I'm randomizing permutations for testing, the last thing I want is:
while whatever:
result = function_of_xs(shuffled(xs))
check result and complain if it's wrong
Why not? Because no trace remains of _which_ permutation provoked the
failure when a failure occurs. Instead code looks like this:
while whatever:
shuffle(xs)
result = function_of_xs(xs) # or xs[:] if the function mutates its arg
check result and complain that `xs` specifically provoked a failure
Indeed, the only clear "use case" that makes sense I've been able to
think of is:
xs = shuffled(xs)
But that's written more easily and efficiently today as
shuffle(xs)
This is in stark contrast to sorted(), where clear use cases abound.
That didn't get in because it's hard to mimic (it's basically as easy
as shuffled()), but because it's exactly what's wanted in all kinds of
contexts in all kinds of code.