Last change
on this file since 29 was
29,
checked in by landauf, 16 years ago
|
updated boost from 1_33_1 to 1_34_1
|
File size:
1012 bytes
|
Rev | Line | |
---|
[29] | 1 | # Copyright David Abrahams 2004. Distributed under the Boost |
---|
| 2 | # Software License, Version 1.0. (See accompanying |
---|
| 3 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
---|
| 4 | r'''>>> import pickle1_ext |
---|
| 5 | >>> import pickle |
---|
| 6 | >>> pickle1_ext.world.__module__ |
---|
| 7 | 'pickle1_ext' |
---|
| 8 | >>> pickle1_ext.world.__safe_for_unpickling__ |
---|
| 9 | 1 |
---|
| 10 | >>> pickle1_ext.world.__name__ |
---|
| 11 | 'world' |
---|
| 12 | >>> pickle1_ext.world('Hello').__reduce__() |
---|
| 13 | (<class 'pickle1_ext.world'>, ('Hello',)) |
---|
| 14 | >>> wd = pickle1_ext.world('California') |
---|
| 15 | >>> pstr = pickle.dumps(wd) |
---|
| 16 | >>> wl = pickle.loads(pstr) |
---|
| 17 | >>> print wd.greet() |
---|
| 18 | Hello from California! |
---|
| 19 | >>> print wl.greet() |
---|
| 20 | Hello from California! |
---|
| 21 | ''' |
---|
| 22 | |
---|
| 23 | def run(args = None): |
---|
| 24 | import sys |
---|
| 25 | import doctest |
---|
| 26 | |
---|
| 27 | if args is not None: |
---|
| 28 | sys.argv = args |
---|
| 29 | return doctest.testmod(sys.modules.get(__name__)) |
---|
| 30 | |
---|
| 31 | if __name__ == '__main__': |
---|
| 32 | print "running..." |
---|
| 33 | import sys |
---|
| 34 | status = run()[0] |
---|
| 35 | if (status == 0): print "Done." |
---|
| 36 | sys.exit(status) |
---|
Note: See
TracBrowser
for help on using the repository browser.