+"""Docstring."""
+
+
+# leading comment
def f():
NO = ''
SPACE = ' '
if t == token.COMMENT: # another trailing comment
return DOUBLESPACE
+
assert p is not None, f"INTERNAL ERROR: hand-made leaf without parent: {leaf!r}"
+
prev = leaf.prev_sibling
if not prev:
prevp = preceding_leaf(p)
if not prevp or prevp.type in OPENING_BRACKETS:
+
return NO
+
if prevp.type == token.EQUAL:
if prevp.parent and prevp.parent.type in {
syms.typedargslist,
syms.dictsetmaker,
}:
return NO
+
###############################################################################
# SECTION BECAUSE SECTIONS
###############################################################################
+
def g():
NO = ''
SPACE = ' '
return DOUBLESPACE
# Another comment because more comments
- assert p is not None, f"INTERNAL ERROR: hand-made leaf without parent: {leaf!r}"
+ assert p is not None, f'INTERNAL ERROR: hand-made leaf without parent: {leaf!r}'
prev = leaf.prev_sibling
if not prev:
# output
+"""Docstring."""
+
+
+# leading comment
def f():
- NO = ''
- SPACE = ' '
- DOUBLESPACE = ' '
+ NO = ""
+ SPACE = " "
+ DOUBLESPACE = " "
t = leaf.type
p = leaf.parent # trailing comment
return NO
if prevp.type == token.EQUAL:
- if prevp.parent and prevp.parent.type in {
- syms.typedargslist,
- syms.varargslist,
- syms.parameters,
- syms.arglist,
- syms.argument,
- }:
+ if (
+ prevp.parent
+ and prevp.parent.type in {
+ syms.typedargslist,
+ syms.varargslist,
+ syms.parameters,
+ syms.arglist,
+ syms.argument,
+ }
+ ):
return NO
elif prevp.type == token.DOUBLESTAR:
- if prevp.parent and prevp.parent.type in {
- syms.typedargslist,
- syms.varargslist,
- syms.parameters,
- syms.arglist,
- syms.dictsetmaker,
- }:
+ if (
+ prevp.parent
+ and prevp.parent.type in {
+ syms.typedargslist,
+ syms.varargslist,
+ syms.parameters,
+ syms.arglist,
+ syms.dictsetmaker,
+ }
+ ):
return NO
def g():
- NO = ''
- SPACE = ' '
- DOUBLESPACE = ' '
+ NO = ""
+ SPACE = " "
+ DOUBLESPACE = " "
t = leaf.type
p = leaf.parent
return NO
if prevp.type == token.EQUAL:
- if prevp.parent and prevp.parent.type in {
- syms.typedargslist,
- syms.varargslist,
- syms.parameters,
- syms.arglist,
- syms.argument,
- }:
+ if (
+ prevp.parent
+ and prevp.parent.type in {
+ syms.typedargslist,
+ syms.varargslist,
+ syms.parameters,
+ syms.arglist,
+ syms.argument,
+ }
+ ):
return NO