thanks a lot<br><br>
<div><span class="gmail_quote">On 5/7/07, <b class="gmail_sendername">Dino Viehland</b> &lt;<a href="mailto:dinov@exchange.microsoft.com">dinov@exchange.microsoft.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div dir="ltr"><font face="Tahoma" color="#000000" size="2">Your class needs to inherit from object for properies (and descriptors in general) to work:</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font>&nbsp;</div>
<div dir="ltr"><font face="tahoma" size="2">
<div>class SampleClass(object):<span class="q"><br>&nbsp;&nbsp;&nbsp; &quot;Sample class with one property&quot;<br>&nbsp;&nbsp;&nbsp; def __init__(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.__testString = &quot;&quot;<br>&nbsp;&nbsp;&nbsp; def SetTestString(self, value):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.__testString = 
value.upper ()<br>&nbsp;&nbsp;&nbsp; def GetTestString(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return self.__testString<br>&nbsp;&nbsp;&nbsp; TestString = property(GetTestString, SetTestString)<br clear="all"></span></div></font></div>
<div style="DIRECTION: ltr">
<hr>
<font face="Tahoma" size="2"><b>From:</b> <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a> [<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:users-bounces@lists.ironpython.com" target="_blank">
users-bounces@lists.ironpython.com</a>] On Behalf Of Kevin Chu [<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:redmoon17@gmail.com" target="_blank">redmoon17@gmail.com</a>]<br><b>Sent:</b> Sunday, May 06, 2007 6:59 PM
<br><b>To:</b> Discussion of IronPython<br><b>Subject:</b> [IronPython] property bug? or my mistake?<br></font><br>&nbsp;</div>
<div><span class="e" id="q_112644e335deb5b4_3">
<div></div>
<div>
<div>I do this walkthought: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://quickstarts.asp.net/Futures/dlr/doc/dlsharedcode.aspx" target="_blank">http://quickstarts.asp.net/Futures/dlr/doc/dlsharedcode.aspx
</a></div>
<div>but when I change&nbsp;some code ,want to get Upper string, but my code is not working</div>
<div>my code is:</div>
<div>&nbsp;</div>
<div>class SampleClass:<br>&nbsp;&nbsp;&nbsp; &quot;Sample class with one property&quot;<br>&nbsp;&nbsp;&nbsp; def __init__(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.__testString = &quot;&quot;<br>&nbsp;&nbsp;&nbsp; def SetTestString(self, value):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.__testString = value.upper
 ()<br>&nbsp;&nbsp;&nbsp; def GetTestString(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return self.__testString<br>&nbsp;&nbsp;&nbsp; TestString = property(GetTestString, SetTestString)<br clear="all"></div>
<div>or </div>
<div>&nbsp;</div>
<div>class SampleClass:<br>&nbsp;&nbsp;&nbsp; &quot;Sample class with one property&quot;<br>&nbsp;&nbsp;&nbsp; def __init__(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.__testString = &quot;&quot;<br>&nbsp;&nbsp;&nbsp; def SetTestString(self, value):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.__testString = str(value).upper() 
<br>&nbsp;&nbsp;&nbsp; def GetTestString(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return self.__testString<br>&nbsp;&nbsp;&nbsp; TestString = property(GetTestString, SetTestString)</div>
<div>&nbsp;</div>
<div>or</div>
<div>&nbsp;</div>
<div>class SampleClass:<br>&nbsp;&nbsp;&nbsp; &quot;Sample class with one property&quot;<br>&nbsp;&nbsp;&nbsp; def __init__(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.__testString = &quot;&quot;<br>&nbsp;&nbsp;&nbsp; def SetTestString(self, value):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.__testString = value 
<br>&nbsp;&nbsp;&nbsp; def GetTestString(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return self.__testString.upper()<br>&nbsp;&nbsp;&nbsp; TestString = property(GetTestString, SetTestString)<br>-- <br>Once in a Redmoon </div></div></span></div></div><br>_______________________________________________
<br>users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:users@lists.ironpython.com">users@lists.ironpython.com</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>Once in a Redmoon