Re: id functions of ints, floats and strings

2008-04-05 Thread Dan Bishop
On Apr 5, 9:30 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > In fact all you can in truth say is that > >a is b --> a == b > You can't even guarantee that. >>> inf = 1e1000 >>> nan = inf / inf >>> nan is nan True >>> nan == nan False -- http://mail.python.org/mailman/listinfo/python-list

Re: id functions of ints, floats and strings

2008-04-05 Thread Steve Holden
Gabriel Genellina wrote: > En Thu, 03 Apr 2008 19:27:47 -0300, <[EMAIL PROTECTED]> escribió: > >> Hi all, >> >> I've been playing around with the identity function id() for different >> types of objects, and I think I understand its behaviour when it comes >> to objects like lists and tuples in wh

Re: id functions of ints, floats and strings

2008-04-03 Thread Gabriel Genellina
En Thu, 03 Apr 2008 19:27:47 -0300, <[EMAIL PROTECTED]> escribió: > Hi all, > > I've been playing around with the identity function id() for different > types of objects, and I think I understand its behaviour when it comes > to objects like lists and tuples in which case an assignment r2 = r1 > (

Re: id functions of ints, floats and strings

2008-04-03 Thread Daniel Fetchinson
> Hi all, > > I've been playing around with the identity function id() for different > types of objects, and I think I understand its behaviour when it comes > to objects like lists and tuples in which case an assignment r2 = r1 > (r1 refers to an existing object) creates an alias r2 that refers to

Re: id functions of ints, floats and strings

2008-04-03 Thread George Sakkis
[EMAIL PROTECTED] wrote: > 1) Which of the above behaviours are reliable? For example, does a1 = > a2 for ints and strings always imply that a1 is a2? No. > 2) From the programmer's perspective, are ids of ints, floats and > string of any practical significance at all (since these types are > im

Re: id functions of ints, floats and strings

2008-04-03 Thread zillow10
On Apr 3, 11:27 pm, [EMAIL PROTECTED] wrote: > Hi all, > > I've been playing around with the identity function id() for different > types of objects, and I think I understand its behaviour when it comes > to objects like lists and tuples in which case an assignment r2 = r1 > (r1 refers to an existi

id functions of ints, floats and strings

2008-04-03 Thread zillow10
Hi all, I've been playing around with the identity function id() for different types of objects, and I think I understand its behaviour when it comes to objects like lists and tuples in which case an assignment r2 = r1 (r1 refers to an existing object) creates an alias r2 that refers to the same o