Le Wednesday 03 September 2008 19:38:13 Bruno Desthuilliers, vous avez écrit :
> FWIW, if there's no computation on getting or setting value, you can
> make it a plain attribute.

Yes, this is the problem with these tiny examples, we don't know at which 
point we must simplify them...

>
> But while it's quite clear that in this example use case it would be
> better  to have only one property (weither square or value, depending on
> which is the most often use), things are not always that simple in real
> world code, and - as you mentionned - there may be times where you have
> interdependant properties and really want to avoid recomputing the same
> thing over and over. Now there's no one size fits all solution here -
> it's an optimization problem, and as such depends on real use cases.

Yes, my advice was exactly in that sense, it's an optimization problem, 
duplicating such a data is a caching mechanism, and should be done knowingly, 
in acceptance of all the complication it comes with.


-- 
_____________

Maric Michaud
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to