Re: Equal sets with unequal print and str() representations

2011-10-19 Thread rusi
On Oct 17, 7:47 am, Terry Reedy wrote: > On 10/16/2011 9:17 PM, Ian Kelly wrote: > > > On Sun, Oct 16, 2011 at 5:52 PM, Ganesh Gopalakrishnan > >  wrote: > >> This probably is known, but a potential pitfall (was, for me) nevertheless. > >> I suspect it is due to hash collisions between 's3' and '

Re: Equal sets with unequal print and str() representations

2011-10-17 Thread Ben Finney
Ganesh Gopalakrishnan writes: > Thanks to all who replied - also to Ben. You're welcome. (Please don't top-post your replies.) > Needless to say I'm new to Python. Welcome to this forum, then! You would be wise to get a solid grounding in Python by working through the Python tutorial from begi

Re: Equal sets with unequal print and str() representations

2011-10-17 Thread Ganesh Gopalakrishnan
Thanks to all who replied - also to Ben. I had foolishly assumed that the same set exhibits the same rep on at least one platform. Like any bug, the falsity of my assumption took months to expose - till then, things had worked fine. Needless to say I'm new to Python. (The double printing is be

Re: Equal sets with unequal print and str() representations

2011-10-17 Thread Ben Finney
Ganesh Gopalakrishnan writes: > This probably is known, but a potential pitfall (was, for me) nevertheless. > I suspect it is due to hash collisions between 's3' and 's13' in this > case? What is the actual problem? What behaviour is occurring that doesn't match your expectation? > >>> S1==S2 >

Re: Equal sets with unequal print and str() representations

2011-10-17 Thread Westley Martínez
On Sun, Oct 16, 2011 at 05:52:03PM -0600, Ganesh Gopalakrishnan wrote: > This probably is known, but a potential pitfall (was, for me) > nevertheless. I suspect it is due to hash collisions between 's3' > and 's13' in this case? It happens only rarely, depending on the > contents of the set. > > >

Re: Equal sets with unequal print and str() representations

2011-10-16 Thread Terry Reedy
On 10/16/2011 9:17 PM, Ian Kelly wrote: On Sun, Oct 16, 2011 at 5:52 PM, Ganesh Gopalakrishnan wrote: This probably is known, but a potential pitfall (was, for me) nevertheless. I suspect it is due to hash collisions between 's3' and 's13' in this case? It happens only rarely, depending on the

Re: Equal sets with unequal print and str() representations

2011-10-16 Thread Ian Kelly
On Sun, Oct 16, 2011 at 5:52 PM, Ganesh Gopalakrishnan wrote: > This probably is known, but a potential pitfall (was, for me) nevertheless. > I suspect it is due to hash collisions between 's3' and 's13' in this case? > It happens only rarely, depending on the contents of the set. I'm not sure ex

Equal sets with unequal print and str() representations

2011-10-16 Thread Ganesh Gopalakrishnan
This probably is known, but a potential pitfall (was, for me) nevertheless. I suspect it is due to hash collisions between 's3' and 's13' in this case? It happens only rarely, depending on the contents of the set. >>> S1 = {'s8', 's3', 's2', 's0', 's7', 's6', 's4', 's13', 's14'} S1 = {'s8', 's