swig/Examples/test-suite/python/default_constructor_runme.py
Stefan Zager 3d444101d1 A slew of changes based on William Fulton's code review.
- Fixed naming conventions; SwigPyBuiltin is used a lot
- Removed use of std::vector
- builtin.swg isn't included if -builtin isn't specified
- Changed many feature names to use a "python:" prefix
- Eliminated static vars in std_pair.i
- Eliminated C++-style comments (//)
- Enabled autodoc and docstring with -builtin
- Fixed non-ansi generated C code
- Detect and complain if two incompatible swig modules are loaded
- Removed argcargvtest_runme3.py, and fixed argcargvtest_runme.py
  so that 2to3 handles it better
- Removed anonymous namespaces
- Eliminated builtin_init typemaps; consolidated functionality into
  SWIG_Python_NewPointerObj
- Eliminate printf warnings from %U conversion character by switching
  to %S, which works just as well
- Fixed li_std_set_runme.py for python3, which returns set members in
  a different order from python2





git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12562 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-29 06:57:02 +00:00

167 lines
3 KiB
Python

import default_constructor
dc = default_constructor
# Old static syntax not supported
#a = dc.new_A()
#dc.delete_A(a)
a = dc.A()
del a
# Old static syntax not supported
#aa = dc.new_AA()
#dc.delete_AA(aa)
aa = dc.AA()
del aa
try:
# Old static syntax not supported
#b = dc.new_B()
b = dc.B()
print "Whoa. new_BB created."
except:
pass
# Old static syntax not supported.
# Swig builtin types have no tp_del entry (only tp_dealloc).
#del_b = dc.delete_B
try:
# Old static syntax not supported.
#bb = dc.new_BB();
bb = dc.BB()
print "Whoa. new_BB created."
except:
pass
# Old static syntax not supported.
# Swig builtin types have no tp_del entry (only tp_dealloc).
#del_bb = dc.delete_BB
try:
# Old static syntax not supported
#c = dc.new_C()
c = dc.C()
print "Whoa. new_C created."
except:
pass
# Old static syntax not supported.
# Swig builtin types have no tp_del entry (only tp_dealloc).
#del_c = dc.delete_C
# Old static syntax not supported.
#cc = dc.new_CC()
#dc.delete_CC(cc)
cc = dc.CC()
del cc
try:
# Old static syntax not supported.
#d = dc.new_D();
d = dc.D()
print "Whoa. new_D created"
except:
pass
# Old static syntax not supported.
# Swig builtin types have no tp_del entry (only tp_dealloc).
#del_d = dc.delete_D
try:
# Old static syntax not supported.
#dd = dc.new_DD()
dd = dc.DD()
print "Whoa. new_DD created"
except:
pass
# Old static syntax not supported.
# Swig builtin types have no tp_del entry (only tp_dealloc).
#dd = dc.delete_DD
try:
# Old static syntax not supported.
#ad = dc.new_AD()
ad = dc.AD()
print "Whoa. new_AD created"
except:
pass
# Old static syntax not supported.
# Swig builtin types have no tp_del entry (only tp_dealloc).
#del_ad = dc.delete_AD
# Old static syntax not supported.
#e = dc.new_E()
#dc.delete_E(e)
e = dc.E()
del e
# Old static syntax not supported.
#ee = dc.new_EE()
#dc.delete_EE(ee)
ee = dc.EE()
del ee
try:
# Old static syntax not supported.
#eb = dc.new_EB()
eb = dc.EB()
print "Whoa. new_EB created"
except:
pass
# Old static syntax not supported.
# Swig builtin types have no tp_del entry (only tp_dealloc).
#del_eb = dc.delete_EB
# Old static syntax not supported.
#f = dc.new_F()
f = dc.F()
try:
del_f = dc.delete_F
print "Whoa. delete_F created"
except AttributeError:
pass
# Old static syntax not supported.
#dc.F_destroy(f)
f.destroy()
# Old static syntax not supported.
#ff = dc.new_FFF()
ff = dc.FFF()
try:
del_ff = dc.delete_FFF
print "Whoa. delete_FFF created"
except AttributeError:
pass
# Old static syntax not supported.
#dc.F_destroy(ff)
ff.destroy()
# Old static syntax not supported.
#g = dc.new_G()
g = dc.G()
try:
del_g = dc.delete_G
print "Whoa. delete_G created"
except AttributeError:
pass
dc.G.destroy(g)
# Old static syntax not supported.
#gg = dc.new_GG()
#dc.delete_GG(gg)
gg = dc.GG()
del gg
import default_constructor
hh = default_constructor.HH(1,1)