Y
Hacker News
new
|
ask
|
show
|
jobs
by
raspasov
1854 days ago
What about classes? Can you re-define those?
2 comments
xapata
1853 days ago
Not only can you redefine classes, you can change the class an object belongs to. Just point `obj.__class__` at something else, or change `cls.__bases__` to reorganize the class's inheritance hierarchy.
link
nerdponx
1853 days ago
Yes, easily. Just re-execute the class definition code.
link