On 12.01.2013 11:24, Alan Gauld wrote:
On 12/01/13 08:09, Jan Riechers wrote:
So to rephrase what you and also other wrote:
By setting "oakTree = Tree()" I create a new "Tree()" class instance.
Now calls to "oakTree.grow()" access functions of the Tree class, by
traversing to it's "Superclass"
On 12/01/13 08:09, Jan Riechers wrote:
So to rephrase what you and also other wrote:
By setting "oakTree = Tree()" I create a new "Tree()" class instance.
Now calls to "oakTree.grow()" access functions of the Tree class, by
traversing to it's "Superclass" Tree.
No, they traverse to its Tree cl
On 12.01.2013 02:19, Mitya Sirenef wrote:
Functions are the same, (called methods), but the self object is
different for each instance, and represents the instance. Consider that
since the logic performed by the method is the same (if it wasn't, you'd
define it as a separate method, right?), the
On 01/11/2013 04:32 PM, Dave Angel wrote:
On 01/11/2013 02:41 PM, Jan Riechers wrote:
>> On 10.01.2013 19:50, Mitya Sirenef wrote:
>>> On 01/10/2013 09:06 AM, richard kappler wrote:
>>>
>>> class Tree(object):
>>> height = 0
>>>
>>> def grow(self):
>>> self.height += 1
>>>
>>> You may have a do
On 01/11/2013 02:41 PM, Jan Riechers wrote:
On 10.01.2013 19:50, Mitya Sirenef wrote:
>> On 01/10/2013 09:06 AM, richard kappler wrote:
>>
>> class Tree(object):
>> height = 0
>>
>> def grow(self):
>> self.height += 1
>>
>> You may have a dozen of related functions and you can logically group
>
On 11/01/13 19:41, Jan Riechers wrote:
class Tree(object):
height = 0
def grow(self):
self.height += 1
Actually one question about those "dozens of related" instances
generated by:
greenwoodTree = Tree()
oakTree = Tree()
Both, greenwoodTree and oakTree, are derived f
On 01/11/2013 02:41 PM, Jan Riechers wrote:
> On 10.01.2013 19:50, Mitya Sirenef wrote:
>> On 01/10/2013 09:06 AM, richard kappler wrote:
>>
>> class Tree(object):
>> height = 0
>>
>> def grow(self):
>> self.height += 1
>>
>> You may have a dozen of related functions and you can
On 10.01.2013 19:50, Mitya Sirenef wrote:
On 01/10/2013 09:06 AM, richard kappler wrote:
class Tree(object):
height = 0
def grow(self):
self.height += 1
You may have a dozen of related functions and you can logically group
them together by making them methods of a class, mak
On 01/10/2013 09:06 AM, richard kappler wrote:
Class is still something I struggle with. I think I'm finally starting
> to get my head wrapped around it, but the discussion in a different
> thread has sparked a question. First, please check my understanding:
> A class creates objects, it's lik
On 01/10/2013 09:06 AM, richard kappler wrote:
Since you don't specify Python version or implementation, I'll use
CPython version 2.7 for the details below. Jython (for java
environments) and other implementations are likely to differ in their
garbage collection details. But the effect will be t
On Thu, Jan 10, 2013 at 3:06 PM, richard kappler wrote:
> Class is still something I struggle with. I think I'm finally starting to
> get my head wrapped around it, but the discussion in a different thread has
> sparked a question. First, please check my understanding:
> A class creates objects, i
Class is still something I struggle with. I think I'm finally starting to
get my head wrapped around it, but the discussion in a different thread has
sparked a question. First, please check my understanding:
A class creates objects, it's like a template that allows me to create as
many copies as I
12 matches
Mail list logo