From 3972628de3d569c88451a2a176a1c94d8822b8a6 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Thu, 18 May 2017 07:35:54 -0700 Subject: bpo-30296 Remove unnecessary tuples, lists, sets, and dicts (#1489) * Replaced list() with list comprehension * Replaced dict() with dict comprehension * Replaced set() with set literal * Replaced builtin func() with func() when supported (e.g. any(), all(), tuple(), min(), & max()) --- Lib/_weakrefset.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Lib/_weakrefset.py') diff --git a/Lib/_weakrefset.py b/Lib/_weakrefset.py index 4d0de8ce75..304c66f59b 100644 --- a/Lib/_weakrefset.py +++ b/Lib/_weakrefset.py @@ -157,19 +157,19 @@ class WeakSet: __le__ = issubset def __lt__(self, other): - return self.data < set(ref(item) for item in other) + return self.data < set(map(ref, other)) def issuperset(self, other): return self.data.issuperset(ref(item) for item in other) __ge__ = issuperset def __gt__(self, other): - return self.data > set(ref(item) for item in other) + return self.data > set(map(ref, other)) def __eq__(self, other): if not isinstance(other, self.__class__): return NotImplemented - return self.data == set(ref(item) for item in other) + return self.data == set(map(ref, other)) def symmetric_difference(self, other): newset = self.copy() -- cgit v1.2.1