Skip to main content
1 of 2
noamtm
  • 235
  • 2
  • 5

Why did Python designers decide not to declare vars?

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/const/var
  • Swift: let/var
  • Kotlin: val/var
  • Rust: let
  • Go: 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.

noamtm
  • 235
  • 2
  • 5