points by sakesun 2 days ago | 0 comments
I've been doing things in Python for over 20 years. Only recently I learn that I can do this.
>>> Dog.__bases__ = (Cat,)
>>> isinstance(dog, Dog)
True
>>> isinstance(dog, Cat)
True
>>>[–] gregdeon 2 days ago
This is wild. Is it part of Python's specification, or an implementation detail of CPython?
[–] pjmlp 1 day ago