from thisRCPPy import *

print '\ntestcase for thisRCP as from python extended class (using enable_shared_from_this):'
class KDer(K):
  def __init__(self):
    K.__init__(self)

k = KDer()
assert k.getThisRCP2() is not None
k2 = k.getThisRCP2()
if 1:
  print k2.foo();
  del k
  print 'with the `del k` statement the following statement will crash the program:';
  print k2.foo();
  print 'this line is never reached';
  #del k
  del k2

