Re: [Tutor] Help with OOP!

2012-11-05 Thread Steven D'Aprano
On 30/10/12 17:56, Pete wrote: I'm taking this class on python at UCSC. They said this list could help. I don't' understand OOP and I'm having a hard time understanding the "scope" and why the def inside class are not like function But they are like functions. Can you explain in more detail wha

Re: [Tutor] Help with OOP!

2012-11-05 Thread Oscar Benjamin
On 30 October 2012 06:56, Pete wrote: > I’m taking this class on python at UCSC. They said this list could help. I > don’t’ understand OOP and I’m having a hard time understanding the “scope” > and why the def inside class are not like function –plus I can’t get my > c-brain around the implicit ty

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: http://mail.python.org/pipermail/edu-sig/2000-April/000

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 > cl

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,

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 t

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

2005-10-21 Thread Liam Clarke
On 10/21/05, Andrew P <[EMAIL PROTECTED]> 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 chapte

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

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

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