
May 30, 2021
12:30 a.m.
On Sun, May 30, 2021 at 5:18 PM Stephen J. Turnbull <turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:
Jonathan Fine writes:
tmp = list(sorted(d.items()))
The list() call is redundant. sorted() always returns a new list.
Correct.
Ditto, reversed(). The method versions are in-place.
Not correct - reversed() is a parallel to iter() and returns a reversed iterator. ChrisA