From: Ɓukasz Langa Date: Tue, 8 May 2018 23:42:41 +0000 (-0700) Subject: Fix docstrings of visit_stmt and normalize_invisible_parens X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/a68dd928e681cc6a921f39b2c3fc1f05e15afdd3?ds=inline Fix docstrings of visit_stmt and normalize_invisible_parens --- diff --git a/black.py b/black.py index 36380e6..eb99a41 100644 --- a/black.py +++ b/black.py @@ -1257,9 +1257,8 @@ class LineGenerator(Visitor[Line]): The relevant Python language `keywords` for a given statement will be NAME leaves within it. This methods puts those on a separate line. - `parens` holds pairs of nodes where invisible parentheses should be put. - Keys hold nodes after which opening parentheses should be put, values - hold nodes before which closing parentheses should be put. + `parens` holds a set of string leaf values immeditely after which + invisible parens should be put. """ normalize_invisible_parens(node, parens_after=parens) for child in node.children: @@ -2205,6 +2204,9 @@ def normalize_string_quotes(leaf: Leaf) -> None: def normalize_invisible_parens(node: Node, parens_after: Set[str]) -> None: """Make existing optional parentheses invisible or create new ones. + `parens_after` is a set of string leaf values immeditely after which parens + should be put. + Standardizes on visible parentheses for single-element tuples, and keeps existing visible parentheses for other tuples and generator expressions. """