On Fri, May 4, 2012 at 9:29 AM, Lion Chen<[email protected]> wrote:
Hi, All,
here are the codes:
class a:
pass
i = a ()
j = a ()
k = a ()
i< j returns True
j< k returns False
why?
Lion Chen
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Did you look at what I, j, and k are? They are names of objects.
When I ran your code my inequalities were different.
What you are seeing is likely some comparison of the location of the
objects over which you have no control
i = a()
j = a()
k = a()
i< j
False
j< k
True
i
<__main__.a instance at 0xb76d0a2c>
j
<__main__.a instance at 0xb76d096c>
k
<__main__.a instance at 0xb76d09ec>
but why have i got the same results every time i run the codes?
even when i restart the python interpreter, seems like i, j, k have the
fixed values.
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor