Skip to content

Commit

Permalink
Update preview docs for psf#2926, psf#2990, psf#2991, psf#3035
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-hilden committed Jun 24, 2022
1 parent fa6caa6 commit d80ce36
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions docs/the_black_code_style/future_style.md
Expand Up @@ -52,25 +52,37 @@ tracked in [this issue](https://github.com/psf/black/issues/2188).

### Removing trailing newlines after code block open

_Black_ will remove trailing newlines after code block openings. That means that the
following code:
_Black_ will remove trailing newlines after code block openings. For example:

```python
def my_func():

print("The line above me will be deleted!")

print("But the line above me won't!")
```

Will be changed to:
will be changed to:

```python
def my_func():
print("The line above me will be deleted!")

print("But the line above me won't!")
```

This new feature will be applied to **all code blocks**: `def`, `class`, `if`, `for`,
`while`, `with`, `case` and `match`.

### Improved parentheses management

_Black_ will format parentheses around return annotations, await expressions and with
statements similarly to other sets of parentheses. For example:

```python
with ((open("bla.txt")) as f, open("x")):
pass
```

will be changed to:

```python
with open("bla.txt") as f, open("x"):
pass
```

0 comments on commit d80ce36

Please sign in to comment.