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''' 5>>> from staticmethod_ext import * 6 7>>> class X1(X): 8... pass 9 10 11>>> x = X(16) 12>>> x1 = X1(17) 13 14 15 16>>> x1.count() 172 18 19>>> x.count() 202 21 22>>> X1.count() 232 24 25>>> X.count() 262 27 28 29>>> x1.magic() 307654321 31 32>>> x.magic() 337654321 34 35>>> X1.magic() 367654321 37 38>>> X.magic() 397654321 40 41 42''' 43 44def run(args = None): 45 import sys 46 import doctest 47 48 if args is not None: 49 sys.argv = args 50 return doctest.testmod(sys.modules.get(__name__)) 51 52if __name__ == '__main__': 53 print("running...") 54 import sys 55 status = run()[0] 56 if (status == 0): print("Done.") 57 sys.exit(status) 58