[IronPython] property bug? or my mistake?

Kevin Chu redmoon17 at gmail.com
Sun May 6 18:59:49 PDT 2007


I do this walkthought:
http://quickstarts.asp.net/Futures/dlr/doc/dlsharedcode.aspx
but when I change some code ,want to get Upper string, but my code is not
working
my code is:

class SampleClass:
    "Sample class with one property"
    def __init__(self):
        self.__testString = ""
    def SetTestString(self, value):
        self.__testString = value.upper()
    def GetTestString(self):
        return self.__testString
    TestString = property(GetTestString, SetTestString)
or

class SampleClass:
    "Sample class with one property"
    def __init__(self):
        self.__testString = ""
    def SetTestString(self, value):
        self.__testString = str(value).upper()
    def GetTestString(self):
        return self.__testString
    TestString = property(GetTestString, SetTestString)

or

class SampleClass:
    "Sample class with one property"
    def __init__(self):
        self.__testString = ""
    def SetTestString(self, value):
        self.__testString = value
    def GetTestString(self):
        return self.__testString.upper()
    TestString = property(GetTestString, SetTestString)
-- 
Once in a Redmoon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20070507/c7416e74/attachment.html 


More information about the users mailing list