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
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/76PAC4J2REJJQPCW5UAPELJW4WWPUCTU/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to