MCPcopy Create free account
hub / github.com/pybind/pybind11 / ExtendedExampleVirt

Class ExtendedExampleVirt

tests/test_virtual_functions.py:14–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12
13def test_override(capture, msg):
14 class ExtendedExampleVirt(m.ExampleVirt):
15 def __init__(self, state):
16 super().__init__(state + 1)
17 self.data = "Hello world"
18
19 def run(self, value):
20 print(f"ExtendedExampleVirt::run({value}), calling parent..")
21 return super().run(value + 1)
22
23 def run_bool(self):
24 print("ExtendedExampleVirt::run_bool()")
25 return False
26
27 def get_string1(self):
28 return "override1"
29
30 def pure_virtual(self):
31 print(f"ExtendedExampleVirt::pure_virtual(): {self.data}")
32
33 class ExtendedExampleVirt2(ExtendedExampleVirt):
34 def __init__(self, state):

Callers 1

test_overrideFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_overrideFunction · 0.68