mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
* 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user