diff --git a/papyri/gen.py b/papyri/gen.py index bd4ce93d..7e31a6c6 100644 --- a/papyri/gen.py +++ b/papyri/gen.py @@ -681,7 +681,7 @@ def visit(self, obj, stack): else: oroot = omod - if not oroot == self.root: + if oroot != self.root: return if obj in self.obj.values(): return @@ -1157,11 +1157,11 @@ def get_example_section_data(self) -> Section: def _compact(self, example_section_data) -> Section: """ - Compact consecutive execution items that do have the same execution status. + Compact consecutive execution items that do have the same execution status. TODO: - This is not perfect as doctest tests that the output is the same, thus when we have a multiline block + This is not perfect as doctest tests that the output is the same, thus when we have a multiline block If any of the intermediate items produce an output, the result will be failure. """ acc: List[Union[MText, Code]] = [] @@ -2347,10 +2347,7 @@ def is_private(path): Determine if a import path, or fully qualified is private. that usually implies that (one of) the path part starts with a single underscore. """ - for p in path.split("."): - if p.startswith("_") and not p.startswith("__"): - return True - return False + return any(p.startswith("_") and not p.startswith("__") for p in path.split(".")) def find_cannonical(qa: str, aliases: List[str]):