Fix typo.
[python_utils.git] / logical_search.py
index 41ed729fc15df80a4477d3094e4dc980869741aa..b6d7479879010d6ea40ef813d03e84574ead7e55 100644 (file)
@@ -1,11 +1,14 @@
 #!/usr/bin/env python3
 
+# © Copyright 2021-2022, Scott Gasch
+
 """This is a module concerned with the creation of and searching of a
 corpus of documents.  The corpus is held in memory for fast
-searching."""
+searching.
 
-from __future__ import annotations
+"""
 
+from __future__ import annotations
 import enum
 import sys
 from collections import defaultdict
@@ -183,7 +186,7 @@ class Corpus(object):
     def invert_docid_set(self, original: Set[str]) -> Set[str]:
         """Invert a set of docids."""
 
-        return set([docid for docid in self.documents_by_docid.keys() if docid not in original])
+        return {docid for docid in self.documents_by_docid if docid not in original}
 
     def get_doc(self, docid: str) -> Optional[Document]:
         """Given a docid, retrieve the previously added Document."""