Re: Multiple inheritance and a broken super() chain

2023-07-03 Thread Mats Wichmann via Python-list
On 7/3/23 12:13, Mats Wichmann via Python-list wrote: To natter on a bit, and possibly muddy the waters even further... Now, as I see it, from the super()'s point of view, there are two inheritance chains, one starting at Left and the other at Right. But *Right.__init__()* is called twice. No:

Re: Multiple inheritance and a broken super() chain

2023-07-03 Thread Chris Angelico via Python-list
On Tue, 4 Jul 2023 at 03:39, Peter Slížik via Python-list wrote: > > Hello. > > The legacy code I'm working with uses a classic diamond inheritance. Let me > call the classes *Top*, *Left*, *Right*, and *Bottom*. > This is a trivial textbook example. The classes were written in the > pre-super() e

Re: Multiple inheritance and a broken super() chain

2023-07-03 Thread Mats Wichmann via Python-list
On 7/3/23 12:01, Richard Damon via Python-list wrote: On 7/3/23 1:38 PM, Peter Slížik via Python-list wrote: Hello. The legacy code I'm working with uses a classic diamond inheritance. Let me call the classes *Top*, *Left*, *Right*, and *Bottom*. This is a trivial textbook example. The classe

Re: Multiple inheritance and a broken super() chain

2023-07-03 Thread Richard Damon via Python-list
On 7/3/23 1:38 PM, Peter Slížik via Python-list wrote: Hello. The legacy code I'm working with uses a classic diamond inheritance. Let me call the classes *Top*, *Left*, *Right*, and *Bottom*. This is a trivial textbook example. The classes were written in the pre-super() era, so all of them ini

Multiple inheritance and a broken super() chain

2023-07-03 Thread Peter Slížik via Python-list
Hello. The legacy code I'm working with uses a classic diamond inheritance. Let me call the classes *Top*, *Left*, *Right*, and *Bottom*. This is a trivial textbook example. The classes were written in the pre-super() era, so all of them initialized their parents and Bottom initialized both Left a