mypy
0bde4b9e - [mypyc] Use MRO of argument for dispatch in singledispatch functions (#10930)

Commit
4 years ago
[mypyc] Use MRO of argument for dispatch in singledispatch functions (#10930) This changes the implementation of singledispatch to look up the correct registered implementation to use at runtime using the MRO of the passed argument, instead of using a chain of isinstance checks for each registered implementation, for the reasons mentioned in mypyc/mypyc#802 (comment). This doesn't support dynamically registering implementations yet, so 2 of the existing singledispatch tests that rely on that are marked as xfails for now.
Author
Parents
Loading