Oct-04-2019, 12:07 PM
I guess one way to think about it is that you can't convert a string to an int by the int() function if the string is not an int.
In Python it appears (I am still learning so don't take as gospel) that casting and conversion are synonyms, but that is not always true. In other languages casting may be an assertion where conversion takes action. In those cases casting an object to a more specific object gives you the ability to act on it differently, but does not necessarily result in a conversion of that object to the more specific object. Forgive me, I babble.
In Python it appears (I am still learning so don't take as gospel) that casting and conversion are synonyms, but that is not always true. In other languages casting may be an assertion where conversion takes action. In those cases casting an object to a more specific object gives you the ability to act on it differently, but does not necessarily result in a conversion of that object to the more specific object. Forgive me, I babble.