0
x, y = 1.1, 1.1
a = 1.1
b = 1.1
print(id(x), id(y), id(a), id(b))
print(x is y, a is b)

I would think that x, y, a, and b would all be tied to the same object/memory location. Does declaring two variables in a single line have something to do with this?

Output:

31705096 54184744 31705048 31705048
False True
TigerhawkT3
  • 48,464
  • 6
  • 60
  • 97
Ash
  • 21
  • 4
  • 1
    I do not see any chained assignment in the question. If you mark as duplicate the minimum standard should be to link something that actually answers the question. – Paul Panzer Feb 25 '17 at 08:27
  • @PaulPanzer - Sorry. It's been a very long day, and nine times out of ten the "this isn't a duplicate" is due to failure to inspect the linked answers. – TigerhawkT3 Feb 25 '17 at 08:52
  • http://stackoverflow.com/questions/38834770/is-operator-behaves-unexpectedly-with-floats might help. – TigerhawkT3 Feb 25 '17 at 08:53

0 Answers0