On 3/26/22 12:04, Ethan Furman wrote:
> On 3/26/22 09:57, malmiteria wrote:
>
>> The core of what i wanna discuss here is that i don't think mro and super 
(mainly because it
>> relies on mro) are very pythonic. Mainly that some behaviors of the mro are 
too implicit, and
>> are silencing what really should be errors.
>
> [...]  In other words, subclassing is a very tight coupling of code, and you 
had better know
> the classes you are inheriting from to get it right -- and that part is the 
programmer's
> responsibility, not Python's.

To add to that, you can write your custom metaclass, or even (and more easily) a class decorator, that goes through the mro and raises an exception if there are any duplicate methods in previous classes that have not been overridden in the new class.

--
~Ethan~
_______________________________________________
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/VIWNDPEHPD2BO7S7YHQTPPK2QBOPQH5Z/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to