[Tutor] odd behavior within __init__

2005-04-15 Thread Jeff Shannon
(Oops, forgot to change this to go to the list...) On 4/14/05, Orri Ganel <[EMAIL PROTECTED]> wrote: > On 4/14/05, Rich Krauter <[EMAIL PROTECTED]> wrote: > > On 4/14/05, Max Noel <[EMAIL PROTECTED]> wrote: > >Well, if you want b and a to refer to the same object, just use b = > > a. > >

Re: [Tutor] odd behavior within __init__

2005-04-14 Thread Orri Ganel
On 4/14/05, Rich Krauter <[EMAIL PROTECTED]> wrote: > Maybe you could use a factory. It would allow you to simplify your Node > class, and encapsulate the instantiation behavior you want outside the > class. Thanks for the suggestion; I think that's what I'll do. On 4/14/05, Max Noel <[EMAIL PRO

Re: [Tutor] odd behavior within __init__

2005-04-14 Thread Rich Krauter
Orri Ganel wrote: Hello all, As part of a project i'm doing (mostly for the fun of it), I have a class which creates a sort of wrapper around any object to make it suitable for use in a custom container. However, if the class receives an already wrapped object, I want it to just return the object

Re: [Tutor] odd behavior within __init__

2005-04-14 Thread Max Noel
On Apr 14, 2005, at 12:58, Orri Ganel wrote: a = Node(1) b = Node(a) 12932600 12932600 1 id(b) 12960632 Any ideas on why this happens, or suggestions as to how to implement the behavior I'm looking for (in which b and a would refer to the same object, have the same id, etc.), would be greatly appre

[Tutor] odd behavior within __init__

2005-04-14 Thread Orri Ganel
Hello all, As part of a project i'm doing (mostly for the fun of it), I have a class which creates a sort of wrapper around any object to make it suitable for use in a custom container. However, if the class receives an already wrapped object, I want it to just return the object (same id and ever