Additions to %types so that a user can specify the code to go into the casting / conversion function
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10223 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
629aae375c
commit
22e3a7b009
3 changed files with 60 additions and 0 deletions
12
Examples/test-suite/python/types_directive_runme.py
Normal file
12
Examples/test-suite/python/types_directive_runme.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
from types_directive import *
|
||||
|
||||
d1 = Time1(2001, 2, 3, 60)
|
||||
newDate = add(d1, 7) # check that a Time1 instance is accepted where Date is expected
|
||||
if newDate.day != 10:
|
||||
raise RuntimeError
|
||||
|
||||
d2 = Time2(1999, 8, 7, 60)
|
||||
newDate = add(d2, 7) # check that a Time2 instance is accepted where Date is expected
|
||||
if newDate.day != 14:
|
||||
raise RuntimeError
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue