gauravssnl / skulpt

Automatically exported from code.google.com/p/skulpt
Other
0 stars 0 forks source link

__str__ method not called for user defined class #98

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
class Point:
    def __init__(self, initX, initY):
        self.x = initX
        self.y = initY

    def __str__(self):
        print "in __str__"
        return str(self.x, ",", self.y)

p = Point(1,2)
print p
print str(p)

Should print (1, 2)  but instead prints <__main__.Point object>
Message in __str__ is not displayed either.

Original issue reported on code.google.com by bonelake on 9 Jul 2011 at 5:34

GoogleCodeExporter commented 8 years ago
Fixed in 5cffc28025be

Original comment by millb...@luther.edu on 13 Nov 2011 at 4:56

GoogleCodeExporter commented 8 years ago
The change for this is done now.

Original comment by millb...@luther.edu on 13 Nov 2011 at 4:56