28 Jun
2022
28 Jun
'22
11:48 a.m.
Currently, Pyright (VS Code) seems to take into account only the first protocol
It takes into account method reference order (MRO). That typically means the first protocol, although it might be different if the method comes from a base class of that protocol. At runtime, you cannot inherit from multiple protocol classes like this. If you try to run your code, you'll see that you receive a "TypeError: Cannot create a consistent method resolution" from the runtime.
Is there something obviously wrong with this idea?
Yeah, I think it breaks both runtime assumptions and core assumptions about the way Protocols are intended to work. -Eric