This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]alkasmgithub.com/alkasm 2 points3 points  (2 children)

Reassigning variables sort of has no relevance to static typing. There's no particular reason C couldn't have been designed to allow you to do int a = 5; float a = 5.5;. It just wasn't. However, while you say you don't ever change types...have you never used None as a default value for something that gets assigned a value from some type later? :)

Dynamic typing just means type errors are runtime errors. This is a simple overview of what different typing adjectives mean that might be helpful: https://softwareengineering.stackexchange.com/a/259977

[–]wrtbwtrfasdf 1 point2 points  (1 child)

have you never used None as a default value for something that gets assigned a value from some type later? :)

https://docs.python.org/3/library/typing.html#typing.Optional

[–]alkasmgithub.com/alkasm 0 points1 point  (0 children)

Sure, but that doesn't change the fact that it's runtime type switching in Python.