When does Python perform automatic type conversion?
-
Update:
I requested this after reading this post: To greet Go or: "Why I switched from Python and C ++ to Go . " One of the points that a poster makes is as follows:
- It is statically typed, so it is more explicit and third-party code is more readable. It also eliminates the risk of unwanted automatic type conversions (unlike Python).
I had no idea what he meant by "unwanted automatic type conversions." Now, I think, he is talking about implicit numerical conversions . Of course, Python has these values because it 1.0 + 2converts 2to 2.0and returns 3.0.
source
share