Whitespace cleanup in util.py

This commit is contained in:
Tyler Hobbs
2013-11-06 14:28:20 -06:00
parent 854feba004
commit 791d813368

View File

@@ -167,6 +167,7 @@ class _IterationGuard(object):
class WeakSet(object):
def __init__(self, data=None):
self.data = set()
def _remove(item, selfref=ref(self)):
self = selfref()
if self is not None:
@@ -174,6 +175,7 @@ class WeakSet(object):
self._pending_removals.append(item)
else:
self.data.discard(item)
self._remove = _remove
# A list of keys to be removed
self._pending_removals = []
@@ -274,6 +276,7 @@ class WeakSet(object):
self.data.clear()
else:
self.data.difference_update(ref(item) for item in other)
def __isub__(self, other):
if self._pending_removals:
self._commit_removals()
@@ -291,6 +294,7 @@ class WeakSet(object):
if self._pending_removals:
self._commit_removals()
self.data.intersection_update(ref(item) for item in other)
def __iand__(self, other):
if self._pending_removals:
self._commit_removals()
@@ -327,6 +331,7 @@ class WeakSet(object):
self.data.clear()
else:
self.data.symmetric_difference_update(ref(item) for item in other)
def __ixor__(self, other):
if self._pending_removals:
self._commit_removals()
@@ -341,4 +346,4 @@ class WeakSet(object):
__or__ = union
def isdisjoint(self, other):
return len(self.intersection(other)) == 0
return len(self.intersection(other)) == 0