[C++-sig] Re: staticmethod diffs

Nikolay Mladenov nickm at sitius.com
Sun Jan 19 07:20:53 CET 2003


An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030119/0c07899c/attachment.htm>
-------------- next part --------------
'''
>>> from static_method import *

>>> class X1(X):
...     pass


>>> x = X(16)
>>> x1 = X1(17)



>>> x1.count()
2

>>> x.count()
2

>>> X1.count()
2

>>> X.count()
2


>>> x1.magic()
7654321

>>> x.magic()
7654321

>>> X1.magic()
7654321

>>> X.magic()
7654321


'''

def run(args = None):
    import sys
    import doctest

    if args is not None:
        sys.argv = args
    return doctest.testmod(sys.modules.get(__name__))
    
if __name__ == '__main__':
    print "running..."
    import sys
    sys.exit(run()[0])
-------------- next part --------------
A non-text attachment was scrubbed...
Name: static_methods.cpp
Type: application/x-unknown-content-type-cppfile
Size: 1430 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030119/0c07899c/attachment.bin>


More information about the Cplusplus-sig mailing list