----------------------------------------
> From: andreeng...@gmail.com
> Date: Sun, 19 Sep 2010 20:54:01 +0200
> Subject: Re: [Tutor] FW: Can this be done easly
> To: rwob...@hotmail.com
> CC: tutor@python.org
>
> On Sun, Sep 19, 2010 at 8:33 PM, Roelof Wobben wrote:
>
>> Hello,
>>
>> I changed the programm to this :
>>
>> import unittest
>> class Point:
>> def __init__(self, x=0, y=0):
>> self.x = x
>> self.y = y
>>
>> class Rectangle(object):
>> def __init__(self, base_point, width=0, length=0):
>> self.base_point = base_point
>> self.width = width
>> self.length = length
>>
>> def moverect(roelof, dx, dy):
>> roelof.base_point.y += dy
>> roelof.base_point.x +=dx
>> return roelof
>>
>> r = Rectangle(Point(3, 4), 20, 30)
>> moverect(r, 10, 11)
>> assert r.base_point.x == 13, "wrong x position %d" % r.base_point.x
>> assert r.base_point.y == 15, "wrong y position %d" % r.base_point.y
>>
>> But no output at all
>
> Which output had you expected, and why?
>
>
> --
> André Engels, andreeng...@gmail.com
 
Hello, 
 
Oke, I see it now. There is only output when it's not right.
 
Roelof

                                          
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to