Python director documentation correction
Fixes #https://github.com/swig/www/issues/2 [skip ci]
This commit is contained in:
parent
7c3eca368b
commit
76d813f321
1 changed files with 6 additions and 4 deletions
|
|
@ -2841,6 +2841,7 @@ the methods one() and two() (but not three()):
|
||||||
class Foo {
|
class Foo {
|
||||||
public:
|
public:
|
||||||
Foo(int foo);
|
Foo(int foo);
|
||||||
|
virtual ~Foo();
|
||||||
virtual void one();
|
virtual void one();
|
||||||
virtual void two();
|
virtual void two();
|
||||||
};
|
};
|
||||||
|
|
@ -2861,11 +2862,12 @@ then at the python side you can define
|
||||||
import mymodule
|
import mymodule
|
||||||
|
|
||||||
class MyFoo(mymodule.Foo):
|
class MyFoo(mymodule.Foo):
|
||||||
def __init__(self, foo):
|
def __init__(self, foo):
|
||||||
mymodule.Foo(self, foo)
|
mymodule.Foo.__init__(self, foo)
|
||||||
|
# super().__init__(foo) # Alternative construction for Python3
|
||||||
|
|
||||||
def one(self):
|
def one(self):
|
||||||
print "one from python"
|
print "one from python"
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue