|
1 | 1 | # Copyright David Abrahams 2004. Distributed under the Boost |
2 | 2 | # Software License, Version 1.0. (See accompanying |
3 | 3 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 4 | +from __future__ import print_function |
4 | 5 | """ |
5 | 6 | >>> from args_ext import * |
6 | 7 |
|
|
26 | 27 |
|
27 | 28 | >>> try: f(1, 2, 'hello', bar = 'baz') |
28 | 29 | ... except TypeError: pass |
29 | | -... else: print 'expected an exception: unknown keyword' |
| 30 | +... else: print('expected an exception: unknown keyword') |
30 | 31 |
|
31 | 32 |
|
32 | 33 | Exercise the functions using default stubs |
|
72 | 73 |
|
73 | 74 | >>> try: q.f(1, 2, 'hello', bar = 'baz') |
74 | 75 | ... except TypeError: pass |
75 | | -... else: print 'expected an exception: unknown keyword' |
| 76 | +... else: print('expected an exception: unknown keyword') |
76 | 77 |
|
77 | 78 | Exercise member functions using default stubs |
78 | 79 | |
|
95 | 96 |
|
96 | 97 | >>> xfuncs = (X.inner0, X.inner1, X.inner2, X.inner3, X.inner4, X.inner5) |
97 | 98 | >>> for f in xfuncs: |
98 | | -... print f(q,1).value(), |
99 | | -... print f(q, n = 1).value(), |
100 | | -... print f(q, n = 0).value(), |
101 | | -... print f.__doc__.splitlines()[1:5] |
| 99 | +... print(f(q,1).value(), end=' ') |
| 100 | +... print(f(q, n = 1).value(), end=' ') |
| 101 | +... print(f(q, n = 0).value(), end=' ') |
| 102 | +... print(f.__doc__.splitlines()[1:5]) |
102 | 103 | 1 1 0 ['inner0( (X)self, (bool)n) -> Y :', ' docstring', '', ' C++ signature :'] |
103 | 104 | 1 1 0 ['inner1( (X)self, (bool)n) -> Y :', ' docstring', '', ' C++ signature :'] |
104 | 105 | 1 1 0 ['inner2( (X)self, (bool)n) -> Y :', ' docstring', '', ' C++ signature :'] |
@@ -135,10 +136,10 @@ def run(args = None): |
135 | 136 | return doctest.testmod(sys.modules.get(__name__)) |
136 | 137 |
|
137 | 138 | if __name__ == '__main__': |
138 | | - print "running..." |
| 139 | + print("running...") |
139 | 140 | import sys |
140 | 141 | status = run()[0] |
141 | | - if (status == 0): print "Done." |
| 142 | + if (status == 0): print("Done.") |
142 | 143 | import args_ext |
143 | 144 | help(args_ext) |
144 | 145 | sys.exit(status) |
|
0 commit comments