The sorted function returns a list instead of an iterator. It's explicitly written in the documentation and therefore explains the behavior (you can compare lists structurally, but you can't do that obviously with the iterators without iterating them).
The
sorted
function returns a list instead of an iterator. It's explicitly written in the documentation and therefore explains the behavior (you can compare lists structurally, but you can't do that obviously with the iterators without iterating them).