PageRenderTime 39ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/python/smart_pointer_simple_runme.py

#
Python | 13 lines | 10 code | 3 blank | 0 comment | 2 complexity | 8f901caa413e205592086ad508fff751 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. from smart_pointer_simple import *
  2. f = Foo()
  3. b = Bar(f)
  4. b.x = 3
  5. if b.getx() != 3:
  6. raise RuntimeError
  7. fp = b.__deref__()
  8. fp.x = 4
  9. if fp.getx() != 4:
  10. raise RuntimeError