skip at pobox.com
Fri Jun 6 14:06:23 CEST 2003
Following up my own post... I later realized I had to be careful not to
wipe out the persistent set's _data attribute because it might then become
non-persistent. A quick scan of sets.py revealed that the Set.__iand__
method needed to be changed.
def __init__(self, file, iterable=None):
self._data = shelve.open(file)
if iterable is not None:
def __iand__(self, other):
"""Update a set with the intersection of itself and another."""
ia = (self & other)._data
Again, no tests yet. Maybe I'll get around to adapting some of the tests
from the sets module unit tests...
More information about the Python-list