Re: [Tutor] Staticmethod & Classmethod Question

2012-02-25 Thread Steven D'Aprano
Chris Kavanagh wrote: I know this will sound stupid, but why would the method care which instance it's called on?? I think this is where my confusion is coming in. . .I hope I've made sense here. . . Typical use for class instances is to store per-instance information. For example, both "sp

Re: [Tutor] Staticmethod & Classmethod Question

2012-02-25 Thread Chris Kavanagh
On 2/25/2012 4:34 AM, Dave Angel wrote: On 02/25/2012 03:31 AM, Chris Kavanagh wrote: Hey Everyone, I came across this code in 'A Byte Of Python' & realized there was a line I didn't understand. The line is "howMany = staticmethod(howMany)" (Complete code pasted below.) I don't think, in my

Re: [Tutor] Staticmethod & Classmethod Question

2012-02-25 Thread Dave Angel
On 02/25/2012 03:31 AM, Chris Kavanagh wrote: Hey Everyone, I came across this code in 'A Byte Of Python' & realized there was a line I didn't understand. The line is "howMany = staticmethod(howMany)" (Complete code pasted below.) I don't think, in my very short Python career, I've h

Re: [Tutor] Staticmethod & Classmethod Question

2012-02-25 Thread Alan Gauld
On 25/02/12 08:31, Chris Kavanagh wrote: I don't think, in my very short Python career, I've heard of a staticmethod or classmethod. There's very little explanation of them in the book. I've googled them, but am still confused on exactly what they are & why they should be used. The only sense I

[Tutor] Staticmethod & Classmethod Question

2012-02-25 Thread Chris Kavanagh
Hey Everyone, I came across this code in 'A Byte Of Python' & realized there was a line I didn't understand. The line is "howMany = staticmethod(howMany)" (Complete code pasted below.) I don't think, in my very short Python career, I've heard of a staticmethod or classmethod. There's very