print("Hello") def world(): print("Hello") world()
Gets corrected to:
print("Hello") def world(): print("Hello") world()
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.