470,619 Members | 1,960 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,619 developers. It's quick & easy.

Re: properties setting each other

Le Wednesday 03 September 2008 16:44:10 Maric Michaud, vous avez écrit*:
* * * * *def _setsquare(self, v) :
* * * * * * * * *# some extra logic here
* * * * * * * * *self._square = s

* * * * *def fsetsquare(self,s):
* * * * * * * * *self._setsquare(s)
* * * * * * * * *self._setvalue = math.sqrt(s)

* * * * *def _setvalue(self, val):
* * * * * * * * *# some extra logic here
* * * * * * * * *self._internalval=val

* * * * *def fsetvalue(self, val):
* * * * * * * * *self._setvalue(val)
* * * * * * * * *self._setsquare=pow(val,2)
Oh sorry for this last version the setters should be :

def fsetsquare(self,s):
self._setsquare(s)
self._setvalue = math.sqrt(self.square)

def fsetvalue(self, val):
self._setvalue(val)
self._setsquare=pow(self.value, 2)

as we don't know what is done in _setXXX methods.

--
_____________

Maric Michaud
Sep 3 '08 #1
0 1026

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Chuck Bowling | last post: by
5 posts views Thread by rjl444 | last post: by
reply views Thread by =?Utf-8?B?UmljayBHbG9z?= | last post: by
13 posts views Thread by Dave | last post: by
2 posts views Thread by Jan Eliasen | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.