Re: [Tutor] Questions about classes

2012-11-13 Thread Steven D'Aprano
On 14/11/12 09:50, Ciaran Mooney wrote: Hi, Was hoping someone could help me. I have downloaded the latest pygame 1.9.1 i think) to a Mac powerbook OS 10.4.11. What does this question have to do with classes? When starting a brand new discussion, start with a brand new email thread: * do NOT

Re: [Tutor] Questions about classes

2012-11-13 Thread Ciaran Mooney
Hi, Was hoping someone could help me. I have downloaded the latest pygame 1.9.1 i think) to a Mac powerbook OS 10.4.11. Python 3 does not recognise pygame although python 2.7 version does (unfortunately have never programmed python 2.7 and don't no how). Any help would be much appreciated. T

Re: [Tutor] Questions about classes

2012-11-13 Thread Steven D'Aprano
On 13/11/12 13:49, brandon w wrote: 1. I saw in the book an assignment written like this: class HumanBeing: def makeName(self, name): *self.name = name* * * Why is it not written like this?: class HumanBeing: def makeName(self, name): * na

Re: [Tutor] Questions about classes

2012-11-13 Thread Alan Gauld
On 13/11/12 02:49, brandon w wrote: class HumanBeing: def makeName(self, name): * self.name = name * * Why is it not written like this?: class HumanBeing: def makeName(self, name): * name = self.name Because they two completely different things :

Re: [Tutor] Questions about classes

2012-11-13 Thread Dave Angel
On 11/12/2012 09:49 PM, brandon w wrote: > I have been trying to understand classes. I have been studying from a book > I picked up recently. > I have two questions about them. > > 1. I saw in the book an assignment written like this: > > class HumanBeing: > def makeName(self, name): >

Re: [Tutor] Questions about classes

2012-11-12 Thread R. Alan Monroe
> 2. Why use a class in the first place? What is the purpose of > constructing a class instead of just writing a program with a bunch > of functions? Sometimes, you DO just write programs with functions. A class can be useful if you have a bunch of a thing. Like a monster. Each monster can know

Re: [Tutor] Questions about classes

2012-11-12 Thread Mark Lawrence
On 13/11/2012 02:49, brandon w wrote: I have been trying to understand classes. I have been studying from a book I picked up recently. I have two questions about them. 1. I saw in the book an assignment written like this: class HumanBeing: def makeName(self, name): *

[Tutor] Questions about classes

2012-11-12 Thread brandon w
I have been trying to understand classes. I have been studying from a book I picked up recently. I have two questions about them. 1. I saw in the book an assignment written like this: class HumanBeing: def makeName(self, name): *self.name = name* * * Why is it not writte