Re: when do two names cease to refer to the same string object?

2006-03-03 Thread Steven D'Aprano
On Thu, 02 Mar 2006 20:45:10 -0500, John Salerno wrote: > To test this out a wrote a little script as an exercise: > > for num in range(1, 10): > x = 'c' * num > y = 'c' * num > > if x is y: > print 'x and y are the same object with', num, 'characters' > el

Re: when do two names cease to refer to the same string object?

2006-03-02 Thread John Salerno
Farshid Lashkari wrote: > I asked a similar question a few weeks ago. I think the answers I got > will also answer your question as well. Here's a link to the thread: > > http://groups.google.com/group/comp.lang.python/browse_thread/thread/2f6f1d399ba94a7b/f564a219ffe44149?lnk=st&rnum=1&hl=en#f56

Re: when do two names cease to refer to the same string object?

2006-03-02 Thread Farshid Lashkari
I asked a similar question a few weeks ago. I think the answers I got will also answer your question as well. Here's a link to the thread: http://groups.google.com/group/comp.lang.python/browse_thread/thread/2f6f1d399ba94a7b/f564a219ffe44149?lnk=st&rnum=1&hl=en#f564a219ffe44149 -Farshid -- http

when do two names cease to refer to the same string object?

2006-03-02 Thread John Salerno
To test this out a wrote a little script as an exercise: for num in range(1, 10): x = 'c' * num y = 'c' * num if x is y: print 'x and y are the same object with', num, 'characters' else: print 'x and y are not the same object at', num,