In Python when you want a local variable, you just assign to it x = 10.
In most modern languages you declare local vars (regardless of type):
- JavaScript: let
let/constconst/varvar - Swift: let
let/varvar - Kotlin: val
val/varvar - Rust: let
let - Go: var
var - ...
...
Is there any documentation as to why this approach was taken in Python? I couldn't find anything that explains this decision.
In Python 3 they broke a lot of the syntax, so I take it they still thought/think it's a good idea.
To clarify: I'm not asking for pros and cons here. Just wondering why Python designers made this specific choice.