|
3 | 3 | >>> from defaults_ext import * |
4 | 4 | >>> bar(1) |
5 | 5 | 'int(1); char(D); string(default); double(0.0); ' |
| 6 | +
|
6 | 7 | >>> bar(2, 'X') |
7 | 8 | 'int(2); char(X); string(default); double(0.0); ' |
| 9 | +
|
8 | 10 | >>> bar(3, 'Y', "Hello World") |
9 | 11 | 'int(3); char(Y); string(Hello World); double(0.0); ' |
| 12 | +
|
10 | 13 | >>> bar(4, 'Z', "Hi There", 3.3) |
11 | 14 | 'int(4); char(Z); string(Hi There); double(3.3); ' |
| 15 | +
|
12 | 16 | >>> foo(1) |
13 | 17 | 'int(1); char(D); string(default); double(0.0); ' |
| 18 | +
|
14 | 19 | >>> foo(2, 'X') |
15 | 20 | 'int(2); char(X); string(default); double(0.0); ' |
| 21 | +
|
16 | 22 | >>> foo(3, 'Y', "Hello World") |
17 | 23 | 'int(3); char(Y); string(Hello World); double(0.0); ' |
| 24 | +
|
18 | 25 | >>> foo(4, 'Z', "Hi There", 3.3) |
19 | 26 | 'int(4); char(Z); string(Hi There); double(3.3); ' |
| 27 | +
|
20 | 28 | >>> x = X() |
21 | 29 | >>> x.bar(1) |
22 | 30 | 'int(1); char(D); string(default); double(0.0); ' |
| 31 | +
|
23 | 32 | >>> x.bar(2, 'X') |
24 | 33 | 'int(2); char(X); string(default); double(0.0); ' |
| 34 | +
|
25 | 35 | >>> x.bar(3, 'Y', "Hello World") |
26 | 36 | 'int(3); char(Y); string(Hello World); double(0.0); ' |
| 37 | +
|
27 | 38 | >>> x.bar(4, 'Z', "Hi There", 3.3) |
28 | 39 | 'int(4); char(Z); string(Hi There); double(3.3); ' |
| 40 | +
|
29 | 41 | >>> x.foo(5) |
30 | 42 | 'int(5); bool(0); ' |
| 43 | +
|
31 | 44 | >>> x.foo(6, 0) |
32 | 45 | 'int(6); bool(0); ' |
| 46 | +
|
33 | 47 | >>> x.foo(7, 1) |
34 | 48 | 'int(7); bool(1); ' |
| 49 | +
|
35 | 50 | >>> x.foo("A") |
36 | 51 | 'string(A); bool(0); ' |
| 52 | +
|
37 | 53 | >>> x.foo("B", False) |
38 | 54 | 'string(B); bool(0); ' |
| 55 | +
|
39 | 56 | >>> x.foo("C", True) |
40 | 57 | 'string(C); bool(1); ' |
| 58 | +
|
41 | 59 | >>> x.foo([0,1,2], [2,3,4]) |
42 | 60 | 'list([0, 1, 2]); list([2, 3, 4]); bool(0); ' |
| 61 | +
|
43 | 62 | >>> x.foo([0,1,2], [2,3,4], False) |
44 | 63 | 'list([0, 1, 2]); list([2, 3, 4]); bool(0); ' |
| 64 | +
|
45 | 65 | >>> x.foo([0,1,2], [2,3,4], True) |
46 | 66 | 'list([0, 1, 2]); list([2, 3, 4]); bool(1); ' |
| 67 | +
|
47 | 68 | >>> x = X(1) |
48 | 69 | >>> x.get_state() |
49 | 70 | 'int(1); char(D); string(constructor); double(0.0); ' |
| 71 | +
|
50 | 72 | >>> x = X(1, 'X') |
51 | 73 | >>> x.get_state() |
52 | 74 | 'int(1); char(X); string(constructor); double(0.0); ' |
| 75 | +
|
53 | 76 | >>> x = X(1, 'X', "Yabadabadoo") |
54 | 77 | >>> x.get_state() |
55 | 78 | 'int(1); char(X); string(Yabadabadoo); double(0.0); ' |
| 79 | +
|
56 | 80 | >>> x = X(1, 'X', "Phoenix", 3.65) |
57 | 81 | >>> x.get_state() |
58 | 82 | 'int(1); char(X); string(Phoenix); double(3.65); ' |
| 83 | +
|
59 | 84 | >>> x.bar2().get_state() |
60 | 85 | 'int(0); char(D); string(default); double(0.0); ' |
| 86 | +
|
61 | 87 | >>> x.bar2(1).get_state() |
62 | 88 | 'int(1); char(D); string(default); double(0.0); ' |
| 89 | +
|
63 | 90 | >>> x.bar2(1, 'K').get_state() |
64 | 91 | 'int(1); char(K); string(default); double(0.0); ' |
| 92 | +
|
65 | 93 | >>> x.bar2(1, 'K', "Kim").get_state() |
66 | 94 | 'int(1); char(K); string(Kim); double(0.0); ' |
| 95 | +
|
67 | 96 | >>> x.bar2(1, 'K', "Kim", 9.9).get_state() |
68 | 97 | 'int(1); char(K); string(Kim); double(9.9); ' |
| 98 | +
|
69 | 99 | >>> x = X("Phoenix", 1) |
70 | 100 | >>> x.get_state() |
71 | 101 | 'Got exactly two arguments from constructor: string(Phoenix); bool(1); ' |
72 | 102 |
|
| 103 | +>>> def printdoc(x): |
| 104 | +... print x.__doc__ |
| 105 | +
|
| 106 | +>>> printdoc(X.__init__) |
| 107 | +doc of init |
| 108 | +
|
| 109 | +>>> printdoc(Y.__init__) |
| 110 | +doc of Y init |
| 111 | +
|
| 112 | +>>> printdoc(X.bar2) |
| 113 | +doc of X::bar2 |
| 114 | +
|
73 | 115 | """ |
74 | 116 | def run(args = None): |
75 | 117 | import sys |
|
0 commit comments