Pyzotero: a Python client for the Zotero API pyzotero.readthedocs.io
zotero

Replace list comprehensions used for side effects with for loops

+3 -4
+3 -4
src/pyzotero/_client.py
··· 643 643 all_collections.append(clct) 644 644 if clct["meta"].get("numCollections", 0) > 0: 645 645 # add collection to master list & recur with all child collections 646 - [ 646 + for c in self.everything(self.collections_sub(clct["data"]["key"])): 647 647 subcoll(c) 648 - for c in self.everything(self.collections_sub(clct["data"]["key"])) 649 - ] 650 648 651 649 # select all top-level collections or a specific collection and children 652 650 if collid: 653 651 toplevel = [self.collection(collid)] 654 652 else: 655 653 toplevel = self.everything(self.collections_top()) 656 - [subcoll(collection) for collection in toplevel] 654 + for collection in toplevel: 655 + subcoll(collection) 657 656 return all_collections 658 657 659 658 @retrieve