[issue13653] reorder set.intersection parameters for better performance

2019-08-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: The anti-correlation algorithm seems like a plausible heuristic but it can't really know more than the user does about the semantic content of the sets. Also as Terry pointed out, this will have user visible effects. This likely should be published as a

[issue13653] reorder set.intersection parameters for better performance

2012-01-02 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue13653] reorder set.intersection parameters for better performance

2011-12-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: Given that equality is not identify, order does matter, although in 3.2.2 the results are the opposite of what one might expect. a = set((1,2,3)) b = set((1.0, 3.0, 5.0)) print(a&b, b&a) print(a.intersection(b), b.intersection(a)) a &= b print(a) >>> {1.0, 3.

[issue13653] reorder set.intersection parameters for better performance

2011-12-23 Thread Andrew Dalke
Andrew Dalke added the comment: My belief is that the people who use set.intersection with more than two terms are 1) going to pass in a list of sets, and 2) don't care about the specific order. To check the validity of my belief, I did a Google Code Search to find cases of people using set

[issue13653] reorder set.intersection parameters for better performance

2011-12-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks guys. I'll look at this in detail when I get a chance. Offhand, it seems like a good idea though it may rarely be of benefit. The only downsides I see are that it overrides the user's ability to specify the application order and that it would be

[issue13653] reorder set.intersection parameters for better performance

2011-12-22 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue13653] reorder set.intersection parameters for better performance

2011-12-22 Thread Andrew Dalke
New submission from Andrew Dalke : In Issue3069, Arnaud Delobelle proposed support for multiple values to set.intersection() and set.union(), writing "Intersection is optimized by sorting all sets/frozensets/dicts in increasing order of size and only iterating over elements in the smallest."