Make Generic[...] the last parent class for multiple inheritance.
Review Request #14446 — Created May 20, 2025 and submitted — Latest diff uploaded
When there are multiple generics in a class hierarchy, Python can easily
hit a situation where it can't create a consistent MRO during
construction. This is particularly annoying when we're trying to add
generics to older code.The best solution seems to be to put Generic[...] as the last parent
class instead of the first. In fact, the new PEP-695 syntax for generics
does exactly this.
Ran unit tests.
rbintegrations/testing/testcases.py |
---|