Skip to main content

Command Palette

Search for a command to run...

Python Splatting *("-s", "1")

Published
•1 min read•View as Markdown
F

React, Django and SQL developer at Forma.ai

Why do something like this?

subprocess.check_call(
    (
        "git",
        *("-c", "protocol.version=2")
        *("--depth", "1"),
    )
)

Because the black formatter will format it like this which is less readable

subprocess.check_call(
    (
        "git",
        "-c",
        "protocol.version=2",
        "--depth",
        "1",
    )
)