Re: Changing self: if self is a tree how to set to a different self

2008-07-13 Thread Bart Kastermans
Paul McGuire <[EMAIL PROTECTED]> writes: > On Jul 12, 6:18 am, Bart Kastermans <[EMAIL PROTECTED] > macbook.local> wrote: >> This uses the function: >> >> def NoneOr (tree, mem_function, *arguments): >>     """ if tree is not None then tree.mem_function (arguments). """ >>     if tree == None: >>

Re: Changing self: if self is a tree how to set to a different self

2008-07-12 Thread Terry Reedy
Kay Schluehr wrote: Since it is acting on a tree why doesn't the code substitute self in its parent by SS? That's the natural perspective if one considers a tree as a linked structure and inserts and deletes nodes within this structure. I think you are suggesting the same thing I did: > If

Re: Changing self: if self is a tree how to set to a different self

2008-07-12 Thread Kay Schluehr
On 10 Jul., 15:19, Bart Kastermans <[EMAIL PROTECTED]> wrote: > I am playing with some trees. In one of the procedures I wrote > for this I am trying to change self to a different tree. A tree > here has four members (val/type/left/right). I found that self = SS > does not work; I have to write

Re: Changing self: if self is a tree how to set to a different self

2008-07-12 Thread Paul McGuire
On Jul 12, 6:18 am, Bart Kastermans <[EMAIL PROTECTED] macbook.local> wrote: > This uses the function: > > def NoneOr (tree, mem_function, *arguments): >     """ if tree is not None then tree.mem_function (arguments). """ >     if tree == None: >         return None >     else: >         return get

Re: Changing self: if self is a tree how to set to a different self

2008-07-12 Thread Bart Kastermans
Terry Reedy <[EMAIL PROTECTED]> writes: > Bart Kastermans wrote: >> I am playing with some trees. In one of the procedures I wrote >> for this I am trying to change self to a different tree. A tree >> here has four members (val/type/left/right). I found that self = SS >> does not work; I have t

Re: Changing self: if self is a tree how to set to a different self

2008-07-10 Thread Terry Reedy
Bart Kastermans wrote: I am playing with some trees. In one of the procedures I wrote for this I am trying to change self to a different tree. A tree here has four members (val/type/left/right). I found that self = SS does not work; I have to write self.val = SS.val and the same for the othe

Changing self: if self is a tree how to set to a different self

2008-07-10 Thread Bart Kastermans
I am playing with some trees. In one of the procedures I wrote for this I am trying to change self to a different tree. A tree here has four members (val/type/left/right). I found that self = SS does not work; I have to write self.val = SS.val and the same for the other members (as shown below).