__iter__ should actually return an iterator

This commit is contained in:
Jan Petykiewicz 2020-10-10 19:11:52 -07:00
parent 0f35eb5e58
commit 5bc82b9d49

View File

@ -85,7 +85,7 @@ class Library:
return self.get_primary(key) return self.get_primary(key)
def __iter__(self) -> Iterator[str]: def __iter__(self) -> Iterator[str]:
return self.keys() return iter(self.keys())
def __contains__(self, key: str) -> bool: def __contains__(self, key: str) -> bool:
return key in self.primary return key in self.primary