Re: [Tutor] Help(!) with OOP/Composition from Learning Python

2005-10-24 Thread CPIM Ronin
I've been reading about composition vs inheritance, and went back to Learning Python to look at something I found very confusing a year ago. Turns out I still find it very confusing :) Try this example ecology simulation by Kirby Urner:

Re: [Tutor] Help(!) with OOP/Composition from Learning Python

2005-10-21 Thread Kent Johnson
Andrew P wrote: I've been reading about composition vs inheritance, and went back to Learning Python to look at something I found very confusing a year ago. Turns out I still find it very confusing :) The code at the bottom was taken from the OOP chapter, it's a solution to one of the

Re: [Tutor] Help(!) with OOP/Composition from Learning Python

2005-10-21 Thread Andrew P
On 10/21/05, Kent Johnson [EMAIL PROTECTED] wrote: For simple examples just look at Python's built in string, list and dict classes. -Using- OOP isn't the problem :) It's impossible to ignore it's usefulness when programming in Python. But getting from there to thinking non-procedurally is, as

Re: [Tutor] Help(!) with OOP/Composition from Learning Python

2005-10-21 Thread Kent Johnson
Andrew P wrote: On 10/21/05, Kent Johnson [EMAIL PROTECTED] wrote: You can also think of classes very pragmatically, as another tool available to organize your code, just like modules and functions. I realize after all these reposnses that I should have mentioned that I do use classes to

[Tutor] Help(!) with OOP/Composition from Learning Python

2005-10-20 Thread Andrew P
I've been reading about composition vs inheritance, and went back to Learning Python to look at something I found very confusing a year ago. Turns out I still find it very confusing :) The code at the bottom was taken from the OOP chapter, it's a solution to one of the end-of-chapter problems.

Re: [Tutor] Help(!) with OOP/Composition from Learning Python

2005-10-20 Thread Alan Gauld
I've been reading about composition vs inheritance, and went back to Learning Python to look at something I found very confusing a year ago. Turns out I still find it very confusing :) I don;t know the example but from the snippetts you've posted it doresn't look like a particularly good

Re: [Tutor] Help(!) with OOP/Composition from Learning Python

2005-10-20 Thread Andrew P
Hi Alan, thanks for taking the time to answer so thoroughly. I've responded to a few things below. But let me say right off I have gone through the OOP section in your excellent tutor. It was one of my main resources learning Python. I actually have Bertand Meyer's book here (and have written