Re: Replace all references to one object with references to other

2011-08-05 Thread Steven D'Aprano
Jack Bates wrote: > I have two objects, and I want to replace all references to the first > object - everywhere - with references to the second object. What can I > try? Another way of solving your *actual* problem. "Replace all references to object1 with object2 instead" is a means to an end, n

Re: Replace all references to one object with references to other

2011-08-05 Thread John Gordon
In John Gordon writes: > In Jack Bates > writes: > > I have two objects, and I want to replace all references to the first > > object - everywhere - with references to the second object. What can I > > try? > The simplest answer to your question is to assign object2 to object1 I think I ha

Re: Replace all references to one object with references to other

2011-08-05 Thread John Gordon
In Jack Bates writes: > I have two objects, and I want to replace all references to the first > object - everywhere - with references to the second object. What can I > try? The simplest answer to your question is to assign object2 to object1 at the very beginning of your code, but that is a v

Re: Replace all references to one object with references to other

2011-08-05 Thread Emile van Sebille
On 8/5/2011 12:37 PM Jack Bates said... I have two objects, and I want to replace all references to the first object - everywhere - with references to the second object. What can I try? Start with a proxy to your first and have it swap in to the second? EMile -- http://mail.python.org/mailma

Re: Replace all references to one object with references to other

2011-08-05 Thread Ken Watford
On Fri, Aug 5, 2011 at 3:37 PM, Jack Bates wrote: > I have two objects, and I want to replace all references to the first > object - everywhere - with references to the second object. What can I > try? If using PyPy instead of CPython is an option, the "thunk" object space's "become" function can