[issue46019] collections.Counter - Cast list of keys into set to remove iteration over duplicate elements for __le__, __ge__ and __eq__

2021-12-08 Thread Rahul Gupta
Rahul Gupta added the comment: After looking at this again, I agree with you - the key duplication issue seems to have gone. Thank you for providing this feedback, it is very helpful. -- ___ Python tracker <https://bugs.python.org/issue46

[issue46019] collections.Counter - Cast list of keys into set to remove iteration over duplicate elements for __le__, __ge__ and __eq__

2021-12-08 Thread Rahul Gupta
Change by Rahul Gupta : -- keywords: +patch pull_requests: +28222 stage: -> patch review pull_request: https://github.com/python/cpython/pull/2 ___ Python tracker <https://bugs.python.org/issu

[issue46019] collections.Counter - Cast list of keys into set to remove iteration over duplicate elements for __le__, __ge__ and __eq__

2021-12-08 Thread Rahul Gupta
New submission from Rahul Gupta : On lines 725, 737 and 749 there is the following code: '''for c in (self, other) for e in c''' which generates an iterable with all the keys in self and other - casting c to a set will remove duplicates and allow faster itera

[issue23275] Can assign [] = (), but not () = []

2015-05-27 Thread Rahul Gupta
Rahul Gupta added the comment: isn't it logical? [] is a mutable data structure while () is a immutable data structure (b, a) = [1, 2] is fine because a and b are mutable -- nosy: +Rahul Gupta ___ Python tracker <http://bugs.python.org/is