Wenzel Jakob | 38bd711 | 2015-07-05 20:05:44 +0200 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
| 2 | import sys |
| 3 | sys.path.append('.') |
| 4 | |
| 5 | from example import MyObject |
| 6 | from example import make_object_1 |
| 7 | from example import make_object_2 |
| 8 | from example import make_myobject_4 |
| 9 | from example import make_myobject_5 |
| 10 | from example import print_object_1 |
| 11 | from example import print_object_2 |
| 12 | from example import print_object_3 |
| 13 | from example import print_object_4 |
| 14 | from example import print_myobject_1 |
| 15 | from example import print_myobject_2 |
| 16 | from example import print_myobject_3 |
| 17 | from example import print_myobject_4 |
| 18 | |
| 19 | for o in [make_object_1(), make_object_2(), MyObject(3)]: |
| 20 | print("Reference count = %i" % o.getRefCount()) |
| 21 | print_object_1(o) |
| 22 | print_object_2(o) |
| 23 | print_object_3(o) |
| 24 | print_object_4(o) |
| 25 | |
| 26 | for o in [make_myobject_4(), make_myobject_5(), MyObject(6), 7]: |
| 27 | print(o) |
| 28 | if not isinstance(o, int): |
| 29 | print_object_1(o) |
| 30 | print_object_2(o) |
| 31 | print_object_3(o) |
| 32 | print_object_4(o) |
| 33 | print_myobject_1(o) |
| 34 | print_myobject_2(o) |
| 35 | print_myobject_3(o) |
| 36 | print_myobject_4(o) |