jaraco left a comment
Overall, this change is reasonable, though I'd really like to see the functionality encapsulated in a single place that might have a docstring to explain why it's there. The PR would also be substantially better with a test case to capture the expectation (as otherwise this change could get optimized away without any test failures).
Importantly, a change like this needs an entry in the CHANGES.txt file (probably 0.1 bump).
Thanks for your nice feedback.
I added a sorted_walk function with docstring, but I have not fully tested it