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:
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
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
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
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.
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
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