There are a few questions around SO that look into setting __class__
attribute in Python. It is mostly seen as unexpected and dangerous. For example, this question contains answers that discuss the downsides:
How dangerous is setting self.__class__ to something else?
However, are there any "good" uses of this language feature? Is there any criteria or principle as to when one should do this?