black v19.10.b0 Release Notes

Release Date: 2019-10-28 // over 4 years ago
    • ➕ added support for PEP 572 assignment expressions (#711)

    • ➕ added support for PEP 570 positional-only arguments (#943)

    • ➕ added support for async generators (#593)

    • ➕ added support for pre-splitting collections by putting an explicit trailing comma inside (#826)

    • ➕ added black -c as a way to format code passed from the command line (#761)

    • --safe now works with Python 2 code (#840)

    • 🛠 fixed grammar selection for Python 2-specific code (#765)

    • 🛠 fixed feature detection for trailing commas in function definitions and call sites (#763)

    • # fmt: off/# fmt: on comment pairs placed multiple times within the same block of code now behave correctly (#1005)

    • Black no longer crashes on Windows machines with more than 61 cores (#838)

    • Black no longer crashes on standalone comments prepended with a backslash (#767)

    • Black no longer crashes on from ... import blocks with comments (#829)

    • Black no longer crashes on Python 3.7 on some platform configurations (#494)

    • Black no longer fails on comments in from-imports (#671)

    • Black no longer fails when the file starts with a backslash (#922)

    • Black no longer merges regular comments with type comments (#1027)

    • Black no longer splits long lines that contain type comments (#997)

    • ✂ removed unnecessary parentheses around yield expressions (#834)

    • ➕ added parentheses around long tuples in unpacking assignments (#832)

    • ➕ added parentheses around complex powers when they are prefixed by a unary operator (#646)

    • fixed bug that led Black format some code with a line length target of 1 (#762)

    • Black no longer introduces quotes in f-string subexpressions on string boundaries (#863)

    • if Black puts parenthesis around a single expression, it moves comments to the wrapped expression instead of after the brackets (#872)

    • blackd now returns the version of Black in the response headers (#1013)

    • blackd can now output the diff of formats on source code when the X-Diff header is provided (#969)