Wenzel Jakob | 5708221 | 2015-09-04 23:42:12 +0200 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | from __future__ import print_function |
Wenzel Jakob | 38bd711 | 2015-07-05 20:05:44 +0200 | [diff] [blame] | 3 | import sys |
| 4 | sys.path.append('.') |
| 5 | |
| 6 | from example import MyObject |
| 7 | from example import make_object_1 |
| 8 | from example import make_object_2 |
| 9 | from example import make_myobject_4 |
| 10 | from example import make_myobject_5 |
Wenzel Jakob | 6e213c9 | 2015-11-24 23:05:58 +0100 | [diff] [blame] | 11 | from example import make_myobject2_1 |
| 12 | from example import make_myobject2_2 |
Wenzel Jakob | 38bd711 | 2015-07-05 20:05:44 +0200 | [diff] [blame] | 13 | from example import print_object_1 |
| 14 | from example import print_object_2 |
| 15 | from example import print_object_3 |
| 16 | from example import print_object_4 |
| 17 | from example import print_myobject_1 |
| 18 | from example import print_myobject_2 |
| 19 | from example import print_myobject_3 |
| 20 | from example import print_myobject_4 |
Wenzel Jakob | 6e213c9 | 2015-11-24 23:05:58 +0100 | [diff] [blame] | 21 | from example import print_myobject2_1 |
| 22 | from example import print_myobject2_2 |
| 23 | from example import print_myobject2_3 |
| 24 | from example import print_myobject2_4 |
Wenzel Jakob | 38bd711 | 2015-07-05 20:05:44 +0200 | [diff] [blame] | 25 | |
| 26 | for o in [make_object_1(), make_object_2(), MyObject(3)]: |
| 27 | print("Reference count = %i" % o.getRefCount()) |
| 28 | print_object_1(o) |
| 29 | print_object_2(o) |
| 30 | print_object_3(o) |
| 31 | print_object_4(o) |
| 32 | |
| 33 | for o in [make_myobject_4(), make_myobject_5(), MyObject(6), 7]: |
| 34 | print(o) |
| 35 | if not isinstance(o, int): |
| 36 | print_object_1(o) |
| 37 | print_object_2(o) |
| 38 | print_object_3(o) |
| 39 | print_object_4(o) |
| 40 | print_myobject_1(o) |
| 41 | print_myobject_2(o) |
| 42 | print_myobject_3(o) |
| 43 | print_myobject_4(o) |
Wenzel Jakob | 6e213c9 | 2015-11-24 23:05:58 +0100 | [diff] [blame] | 44 | |
| 45 | |
| 46 | for o in [make_myobject2_1(), make_myobject2_2()]: |
| 47 | print(o) |
| 48 | print_myobject2_1(o) |
| 49 | print_myobject2_2(o) |
| 50 | print_myobject2_3(o) |
| 51 | print_myobject2_4(o) |