[C++-sig] return_self_policy

Nikolay Mladenov nickm at sitius.com
Tue Jun 24 06:32:28 CEST 2003


Posting return_self policy implementation

Nikolay
-------------- next part --------------
'''
>>> from return_self import *
>>> l1=Label()
>>> l1 is l1.label("bar")
1
>>> l1 is l1.label("bar").sensitive(0)
1
>>> l1.label("foo").sensitive(0) is l1.sensitive(1).label("bar")
1


'''

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: return_self.cpp
Type: application/x-unknown-content-type-cppfile
Size: 1233 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030624/df34fbf4/attachment.bin>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030624/df34fbf4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: return_self_policy.hpp
Type: application/x-unknown-content-type-hppfile
Size: 1285 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030624/df34fbf4/attachment-0001.bin>


More information about the Cplusplus-sig mailing list