should be union; we want to exclude dangling refs

This commit is contained in:
jan 2023-04-07 16:55:50 -07:00
parent abef8771db
commit c7505a12b0

View File

@ -781,7 +781,7 @@ class MutableLibrary(Library, MutableMapping[str, 'Pattern'], metaclass=ABCMeta)
keep |= set(tops)
new = type(self)()
for key in keep - set(self.keys()):
for key in keep & set(self.keys()):
new._merge(key, self, key)
return new