-
Notifications
You must be signed in to change notification settings - Fork 32
Inheritance
Laeeth Isharc edited this page Mar 19, 2015
·
1 revision
If you wrap both a class and a child of that class, Pyd is smart enough to make the resulting Python classes have a parent-child relationship. Any methods of the parent class will automatically be available to the child class. If the child class overloads any of those methods, it is important that the user wrap them in the module's init function. For example:
These would be exposed to Python by putting this code in PydMain after the call to module_init:
When used in Python, we get the expected behavior:
Polymorphic behavior is also automatically taken care of. Take a function like the following:
And in Python:
interfaces? abstract classes? wut?