Fix caster optimization regression introduced in #3650 (#3659)

* Fix optimization bug introduced in #3650

* Add simple Python extension test for MVF

* Improve comments

* Clarify comment

* Clarify another comment

* Add test docstring

* Fix typo
This commit is contained in:
Aaron Gokaslan
2022-01-31 12:19:48 -05:00
committed by GitHub
parent bf7e5f9284
commit 3a8d92308d
4 changed files with 32 additions and 7 deletions

View File

@@ -472,3 +472,25 @@ def test_pr3635_diamond_f():
assert o.get_f_e() == 5
assert o.get_f_f() == 6
def test_python_inherit_from_mi():
"""Tests extending a Python class from a single inheritor of a MI class"""
class PyMVF(m.MVF):
g = 7
def get_g_g(self):
return self.g
o = PyMVF()
assert o.b == 1
assert o.c == 2
assert o.d0 == 3
assert o.d1 == 4
assert o.e == 5
assert o.f == 6
assert o.g == 7
assert o.get_g_g() == 7