Thank you @bschubert for that clarification. Had I just shown the values without trying to format, I would have been happier. The error was introduced by me and hence the results were the same no matter how it was scrambled!
So, what I wrote as code should work as an example of, easily enough, getting the functionality without asking for a change from the folks who maintain and improve python.
Of course, adding something new instead of modifying random.shuffle() may be an easier way to go and, if needed, you can later create a random.shuffle_many_things()wrapper that tests for the class or some attributes of an object and dispatches the right function to do what you want.
But I hate to ask my next question. Side effects can be irksome in code.
random.shuffle() is designed to shuffle something in place. That may be a good thing for some purposes, but many people (and many languages) suggest doing as much as possible using immutable objects, even if it costs more in terms of time or memory. Python does have frozen versions of some data structures, including tuples or a frozen dictionary and these generally can not be shuffled in place nor should be. You would need to make a new version in the new order.
And what about other data structures? Is it meaningful to shuffle a set. As I inadvertently just showed, the order of presentation may not match the internal order if you do not tell pprint to use the original order.
And is it even meaningful to change the order of a generator that generates one item at a time and may not even be called to completion? I do not see any trivial way to do it other than generating all results (good luck with an infinite generator producing all primes) and then shuffling the list and using it to prime a new generator that is not really generating in the same way.
There has to be a limit on how many different objects you want a function to handle. At the moment, the limit does not include dictionaries for this function and probably quite a few other constructs too. How does one shuffle a matrix or higher dimensional array? We have suggested work-arounds albeit not exactly in-place.
I do note that one variation on dictionaries that I mentioned as an OrderedDict could, in principle allow changes in place. If an implementation of that dictionary included both an embedded dictionary plus an embedded list of keys in the order that various methods should process requests and that handles adding and deleting in rational ways, then that dictionary can be trivially randomized if it supplies a method. As an example, you could ask for the current keys of the dictionary, keep it locked, scramble the list and ask that it replace the old list after checking you did not leave out any or duplicate them and so on and then unlock. Or, as is done in some languages, you merely supply a list or vector of the numbers from 1:N scrambled and the method reorders accordingly from within the object.
So, in a mutable dictionary, in principle, you could extract all current items and delete them all at once in the dictionary then add them back and change it in-place.
But this does not strike me as a common need as other existing methods can get you a result that is similar enough while using a standard dict object.
This is not to disparage the original concern and idea. It is an academic discussion and of course others make the decisions on what to prioritize or even consider.