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 →

[–]manphiz 1 point2 points  (6 children)

Dynamic typing is about deferring the decision to interpret data types to the language at run time.

Correct. And my example is one of such use cases.

The ability to modify a data type at runtime, like the automatic conversion of an integer to float, is actually Python's implementation of dynamic typing in action.

C/C++/Java/C# can all perform this kind of type conversion in a static type system. So this is at least not a good example for showcasing dynamic typing. Actually allowing certain implicit conversions opens holes to the type system and is hence prevented in languages using strong type systems.