Originally published at
www.ikriv.com. Please leave any
comments there.
TL;DR:
Python type cast looks like an assertion:
# Python
x = expression_returning_Base
assert isinstance(x, Derived)
This corresponds to Java or C#
// Java
Derived x = (Derived)expression_returning_Base;
In languages like Java and C++, it is a common situation when at runtime
(
Read more... )