<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Hi all,</DIV>
<DIV> </DIV>
<DIV>I am trying to define a class with copy constructor as following:</DIV>
<DIV> </DIV>
<DIV>class test:</DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px"> def __init__(self, s=None):</DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px"> self=s</DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px"> </DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px">x=[1,2]</DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px"> </DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px">y=test(x)</DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px"> </DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px">print y.__dict__</DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px"> </DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px">it gives </DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px">{}</DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px"> </DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px">The above code doesn't work. </DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px"> </DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px">Questions are:</DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px"> </DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px">1. Can 'self ' be a class attribute?</DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px">2. How to make a copy constructor?</DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px"> </DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px">Thanks for any help.</DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px"> </DIV>
<P dir=ltr style="MARGIN-RIGHT: 0px">Eric</DIV></td></tr></table><br>