
On 5/04/22 5:57 am, malmiteria wrote:
When you're actually in need to passing arguments to super, you very likely know what class you're gonna be targeting, and having to run MRO logic in reverse to call super to the class that comes first before your target in MRO order is what i refer to as "working around MRO".
I think you misunderstand the reason why super() accepts a class argument. It's purely for historical reasons. Originally super() couldn't tell on its own which class it was being called from, and had to be told. It's only there now for backwards compatibility. It's not intended for picking and choosing which class to target -- that's what explicit class.method calls are for. You object to that on the basis that it would prevent other neat stuff that relies on things *not* targeting specific inherited methods. But you can't have it both ways! A particular method either targets a particular base class for its inherited calls or it doesn't. You're trying to have your cake and eat it too. -- Greg