The goal of Python should be as readable as possible. To achieve this, the user must be forced to act in a clearly defined way - for example, you must use exactly four spaces. And in the same way, it determines that the global is a simple element. It means:
A simple instruction consists of one logical line. Simple statements
AND
Programmers note: global is a directive for the parser. It applies only to code analysis at the same time as the global expression. Global instruction
If you write this:
global x = 5
You will have two logical operations:
- Interpreter, please use global x not local
- Assign 5 to x
in one line. It would also look like global applies only to the current line, and not to the entire block of code.
TL TR
This forces the user to write code more readily, which is divided into separate logical operations.
source share