Casting only makes sense for a variable (= memory fragment whose contents may vary)
There are no variables in Python whose contents can change. There are only objects that are not contained in anything: they have existence itself. Then the type of the object cannot change, AFAIK.
Then, casting doesn't make sense in Python. This is my faith and opinion. Correct me if I'm wrong, please.
.
Since casting does not make sense in Python, it makes no sense to try to answer this question.
The question reveals some misunderstandings of the Python foundations, and you will get more profit by getting answers, explaining what led you to think that you need to quit
source share