JavaScript
x
7
1
print("Hello")
2
3
def world():
4
print("Hello")
5
6
world()
7
Gets corrected to:
JavaScript
1
9
1
print("Hello")
2
3
4
def world():
5
print("Hello")
6
7
8
world()
9
I have tried to:
- Reinstall Virtual Studio Code
- Reinstall Python 3.8
- Computer Reboot
- Using other formatters like Black and yapf but got the same result
Advertisement
Answer
Because autopep8 follows PEP8 which suggests 2 blank lines around top-level functions.
Surround top-level function and class definitions with two blank lines.