Re: Python OOP advice

2008-09-17 Thread Bruno Desthuilliers
Simon Hibbs a écrit : Great contributions, thanks both of you. I'm self-tought when it comes to Python and OOP and I haven't yet grown an intuitive feel for how to do things sensibly. While part of the OO design patterns are mostly workaround for lack of dynamism in languages like C++ or Java,

Re: Python OOP advice

2008-09-17 Thread Bruno Desthuilliers
Ben Finney a écrit : Simon Hibbs <[EMAIL PROTECTED]> writes: Orriginaly I thought I'd need to have a hull object which contains component objects, but the component objects need access to members of the hull object (e.g. the hull size) so that looks messy to implement. Was it as messy as this

Re: Python OOP advice

2008-09-17 Thread Simon Hibbs
Great contributions, thanks both of you. I'm self-tought when it comes to Python and OOP and I haven't yet grown an intuitive feel for how to do things sensibly. Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Python OOP advice

2008-09-17 Thread Paul McGuire
On Sep 17, 6:50 am, Simon Hibbs <[EMAIL PROTECTED]> wrote: > I'm rewriting a design application for a science fiction game. in it > you design your own starships. Each component has a mass and cost, but > the mass can either be fixed or it can be expressed as a percentage of > the tonnage of the ov

Re: Python OOP advice

2008-09-17 Thread Ben Finney
Simon Hibbs <[EMAIL PROTECTED]> writes: > Orriginaly I thought I'd need to have a hull object which contains > component objects, but the component objects need access to members > of the hull object (e.g. the hull size) so that looks messy to > implement. Was it as messy as this:: class Shi

Python OOP advice

2008-09-17 Thread Simon Hibbs
I'm rewriting a design application for a science fiction game. in it you design your own starships. Each component has a mass and cost, but the mass can either be fixed or it can be expressed as a percentage of the tonnage of the overall ship. Orriginaly I thought I'd need to have a hull object wh