Revert contains_standalone_comments function changes

This commit is contained in:
Yurii Karabas 2020-08-26 09:35:21 +03:00 committed by Łukasz Langa
parent 1ebe9b70c5
commit 4ca92ac91c

View File

@ -1546,10 +1546,11 @@ def is_triple_quoted_string(self) -> bool:
def contains_standalone_comments(self, depth_limit: int = sys.maxsize) -> bool: def contains_standalone_comments(self, depth_limit: int = sys.maxsize) -> bool:
"""If so, needs to be split before emitting.""" """If so, needs to be split before emitting."""
return any( for leaf in self.leaves:
leaf.type == STANDALONE_COMMENT and leaf.bracket_depth <= depth_limit if leaf.type == STANDALONE_COMMENT and leaf.bracket_depth <= depth_limit:
for leaf in self.leaves return True
)
return False
def contains_uncollapsable_type_comments(self) -> bool: def contains_uncollapsable_type_comments(self) -> bool:
ignored_ids = set() ignored_ids = set()