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

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.

Re: string identity and comparison

2010-12-16 Thread bruno.desthuilli...@gmail.com
On 16 déc, 12:55, Jean-Michel Pichavant jeanmic...@sequans.com 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.

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 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 string content.

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 differents object for

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 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')

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 jeanmic...@sequans.com 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

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

Re: string identity and comparison

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

Re: string identity and comparison

2010-12-16 Thread bruno.desthuilli...@gmail.com
On 16 déc, 15:53, Jean-Michel Pichavant jeanmic...@sequans.com 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

Re: string identity and comparison

2010-12-16 Thread Arnaud Delobelle
Jean-Michel Pichavant jeanmic...@sequans.com 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')

Re: string identity and comparison

2010-12-16 Thread alex23
On Dec 16, 9:55 pm, Jean-Michel Pichavant jeanmic...@sequans.com 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