mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 20:14:27 +01:00
pybind11 example: add inheritance
This commit is contained in:
@@ -2,8 +2,10 @@
|
||||
|
||||
import class_test
|
||||
|
||||
my_class_test = class_test.ClassTest("abc");
|
||||
print(my_class_test.getName())
|
||||
my_class_test.setName("012")
|
||||
print(my_class_test.getName())
|
||||
assert(my_class_test.getName() == my_class_test.name)
|
||||
my_class_test = class_test.ClassTest('abc');
|
||||
assert(my_class_test.getName() == 'abc')
|
||||
my_class_test.setName('012')
|
||||
assert(my_class_test.name == '012')
|
||||
|
||||
my_class_test_derived = class_test.ClassTestDerived('abc', 'def');
|
||||
assert(my_class_test_derived.getName2() == 'abcdef2')
|
||||
|
||||
Reference in New Issue
Block a user