Skip to content

E122: No valid indent for long function call nested in f-string? #1242

Open
@anntzer

Description

For the following example

class T:
    def m1(self):
        print(f"""
preamble
{some_long_func(
    some_long_arg, other_long_arg, more_long_arg)}
postamble
""")

    def m2(self):
        print(f"""
preamble
{some_long_func(
     some_long_arg, other_long_arg, more_long_arg)}
postamble
""")

there appears to be no indentation of the "long args line" that makes pycodestyle not emit a E122 ("continuation line missing indentation or outdented") for that line. (If m1 and m2 are toplevel functions and not methods, then the second form makes pycodestyle happy.)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions