Python3类动态继承变更困境:寻求可行替代方案
Hey folks,
Quick background: I was about to tweak the inheritance chain of a class in my project, until I read How to dynamically change base class of instances at runtime? and realized just how terrible an idea that is. And trust me, I’ve learned this lesson the hard way before—every time I’ve brushed off warnings from other devs here and done something everyone said not to, I’ve ended up debugging a mess for hours (or days).
The problem is, right now I can’t see a way around this. I’m working with two libraries (Frame A and another dependent library), and my current setup seems to leave me stuck between a rock and a hard place. I don’t want to repeat my past mistakes, so I’m hoping to lay out my situation and get some smarter workarounds or alternative approaches from the community.
To add a bit more context (I can expand if needed):
- What I’m actually trying to accomplish is [insert your core goal here, not just the inheritance change]
- The specific conflict with the two libraries is [explain why you thought changing inheritance was necessary]
I’d love to hear any ideas you have—thanks in advance!
内容的提问来源于stack exchange,提问作者ojunk

