Re: string identity and comparison

2010-12-16 Thread alex23
On Dec 16, 9:55 pm, Jean-Michel Pichavant wrote: > I'd like to illutrate the fact that comparing strings using identity is, > most of the time, a bad idea. However I'm searching a short example of > code that yields 2 differents object for the same string content. > > Anyone has that kind of code

Re: string identity and comparison

2010-12-16 Thread Arnaud Delobelle
Jean-Michel Pichavant writes: > Fellows, > > I'd like to illutrate the fact that comparing strings using identity > is, most of the time, a bad idea. However I'm searching a short > example of code that yields 2 differents object for the same string > content. > > id('foo') > 3082385472L > id('fo

Re: string identity and comparison

2010-12-16 Thread bruno.desthuilli...@gmail.com
On 16 déc, 15:53, Jean-Michel Pichavant wrote: > Mel wrote: > > Jean-Michel Pichavant wrote: > > >> Fellows, > > >> I'd like to illutrate the fact that comparing strings using identity is, > >> most of the time, a bad idea. However I'm searching a short example of > >> code that yields 2 different

Re: string identity and comparison

2010-12-16 Thread bruno.desthuilli...@gmail.com
On 16 déc, 15:52, Jean-Michel Pichavant wrote: > bruno.desthuilli...@gmail.com wrote: > > On 16 d c, 12:55, Jean-Michel Pichavant > > wrote: > > >> id('foo') > >> 3082385472L > >> id('foo') > >> 3082385472L > > >> Anyone has that kind of code ? > > > 2 points: > > > 1- an id is only valid for the

Re: string identity and comparison

2010-12-16 Thread Jean-Michel Pichavant
Mel wrote: Jean-Michel Pichavant wrote: Fellows, I'd like to illutrate the fact that comparing strings using identity is, most of the time, a bad idea. However I'm searching a short example of code that yields 2 differents object for the same string content. id('foo') 3082385472L id('foo')

Re: string identity and comparison

2010-12-16 Thread Jean-Michel Pichavant
bruno.desthuilli...@gmail.com wrote: On 16 déc, 12:55, Jean-Michel Pichavant wrote: id('foo') 3082385472L id('foo') 3082385472L Anyone has that kind of code ? 2 points: 1- an id is only valid for the lifetime of a given object - when the object has been collected, the id can be reu

Re: string identity and comparison

2010-12-16 Thread Jean-Michel Pichavant
Jean-Michel Pichavant wrote: Fellows, I'd like to illutrate the fact that comparing strings using identity is, most of the time, a bad idea. However I'm searching a short example of code that yields 2 differents object for the same string content. id('foo') 3082385472L id('foo') 3082385472L

Re: string identity and comparison

2010-12-16 Thread Mel
Jean-Michel Pichavant wrote: > Fellows, > > I'd like to illutrate the fact that comparing strings using identity is, > most of the time, a bad idea. However I'm searching a short example of > code that yields 2 differents object for the same string content. > > id('foo') > 3082385472L > id('foo'

Re: string identity and comparison

2010-12-16 Thread Peter Otten
Peter Otten wrote: > Steve Holden wrote: > >> On 12/16/2010 6:55 AM, Jean-Michel Pichavant wrote: >>> Fellows, >>> >>> I'd like to illutrate the fact that comparing strings using identity is, >>> most of the time, a bad idea. However I'm searching a short example of >>> code that yields 2 differ

Re: string identity and comparison

2010-12-16 Thread Peter Otten
Steve Holden wrote: > On 12/16/2010 6:55 AM, Jean-Michel Pichavant wrote: >> Fellows, >> >> I'd like to illutrate the fact that comparing strings using identity is, >> most of the time, a bad idea. However I'm searching a short example of >> code that yields 2 differents object for the same strin

Re: string identity and comparison

2010-12-16 Thread Steve Holden
On 12/16/2010 6:55 AM, Jean-Michel Pichavant wrote: > Fellows, > > I'd like to illutrate the fact that comparing strings using identity is, > most of the time, a bad idea. However I'm searching a short example of > code that yields 2 differents object for the same string content. > > id('foo') >

Re: string identity and comparison

2010-12-16 Thread bruno.desthuilli...@gmail.com
On 16 déc, 12:55, Jean-Michel Pichavant wrote: > Fellows, > > I'd like to illutrate the fact that comparing strings using identity is, > most of the time, a bad idea. However I'm searching a short example of > code that yields 2 differents object for the same string content. > > id('foo') > 308238

Re: string identity and comparison

2010-12-16 Thread André
On Thursday, December 16, 2010 7:55:20 AM UTC-4, jeanmichel wrote: > Fellows, > > I'd like to illutrate the fact that comparing strings using identity is, > most of the time, a bad idea. However I'm searching a short example of > code that yields 2 differents object for the same string content.

string identity and comparison

2010-12-16 Thread Jean-Michel Pichavant
Fellows, I'd like to illutrate the fact that comparing strings using identity is, most of the time, a bad idea. However I'm searching a short example of code that yields 2 differents object for the same string content. id('foo') 3082385472L id('foo') 3082385472L Anyone has that kind of code