Because there is no way to cast a object in Python, I make a method which do new a child class and copy values from a parental object.usage # cast method def cast(child_class, parental_obj): child_obj = child_class() for attr_name in paren…
child_object.__class__ = ParentalClass
Quote saved.
Login to quote this blog
Failed to save quote. Please try again later.
You cannot quote because this article is private.