Help With Better Design

2007-06-19 Thread apollonius2
Greetings, I have been working on a little project today to help me better understand classes in Python (I really like Python). I am a self taught programmer and consider myself to fall in the "beginner" category for sure. It was initially sparked by reading about "state machines". This was my att

Re: Help With Better Design

2007-06-19 Thread apollonius2
Thank you both for the insightful responses(I knew I came to the right place)! Steven -- The original inspiration was a "State Machine" your code re- write was what I was trying to accomplish but quickly got in way over my head. Thank you for expanding on that aspect of it. That will give me some

Re: Help With Better Design

2007-06-20 Thread apollonius2
> I've written code that looks a lot like that, and it's > a perfectly acceptable pattern IMHO. I don't bother > with the variables ON and OFF, though, as they add no > clarity to simply using 'ON' and 'OFF' for the states. > > [...] > The test portion of the code is actually longer than > the cl

Re: Help With Better Design

2007-06-21 Thread apollonius2
On Jun 21, 12:22 am, Bruno Desthuilliers wrote: > [EMAIL PROTECTED] a écrit : > (snip) > > >>> I would like to be able to get a good hold of the concept > >> state machines ? > > > Well both state machines and classes (objects). That may be a bit of a > > tall order to take on all at once but the