[issue42368] Make set ordered

2020-11-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thank for the suggestion. We've considered it a couple of times before but there are downsides that get in the way: * The related mathematical concept of sets is unordered. * It isn't clear what ordering should be returned by set operations like inters

[issue42368] Make set ordered

2020-11-16 Thread Dan Gheorghe Haiduc
Dan Gheorghe Haiduc added the comment: rhettinger wrote [1]: > The existing setobject code has been finely tuned and micro-optimized over > the years, giving it excellent performance on workloads we care about. This worries me also. But I suppose the tuning should make itself visible in ben

[issue42368] Make set ordered

2020-11-16 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: See also https://mail.python.org/pipermail/python-dev/2019-February/156466.html -- nosy: +methane, rhettinger, xtreak ___ Python tracker __

[issue42368] Make set ordered

2020-11-16 Thread Dan Gheorghe Haiduc
Dan Gheorghe Haiduc added the comment: Oops. The reference number [2] in the previous message should instead be https://stackoverflow.com/q/6614447/235463 . -- ___ Python tracker ___

[issue42368] Make set ordered

2020-11-16 Thread Dan Gheorghe Haiduc
New submission from Dan Gheorghe Haiduc : Now that dicts are ordered[1], would it by any chance make sense to also order sets? A use case that I ran into is trying to reproducibly get a random.choice from a set (after calling random.seed). At first I did not need reproducibility, and I just