1

When this code is executed in the console, it produces a rootselt false, but if it is written in a file and executed in any environment, it will be true, why?

a = 399
b = 399
print(a is b)
#True
  • @SorousHBakhtiary no, it says about interned objects, but it is executed in the console. And I mean, if you execute the same code in the console and in a different environment, the result will be different. – Роман Яровой Aug 29 '21 at 08:30
  • I got you, when a source code gets compiled, immutable objects like `int` and literal tuples can share the reference and it has no impact. Anyway I vote for reopen the question. It will be open again if others vote too – S.B Aug 29 '21 at 08:35
  • @SorousHBakhtiary But where does what you say to my question? I asked that the same code is executed differently in different environments. And you tell me what I know and what has nothing to do with the question. – Роман Яровой Aug 29 '21 at 08:37
  • @SorousHBakhtiary The question to which you dropped the link does not correspond to mine in any way. And I don’t understand why I should create a new question? – Роман Яровой Aug 29 '21 at 08:38
  • No , you didn't understand what I said. I said I get that your question is different so I vote for reopening this question. You don't have to ask a new one. – S.B Aug 29 '21 at 08:40
  • Your question is closed right now, I sent it to the review queue to make it open again. – S.B Aug 29 '21 at 08:41
  • @SorousHBakhtiary, I just don't understand what should I do?) – Роман Яровой Aug 29 '21 at 08:43
  • nothing, just wait – S.B Aug 29 '21 at 08:44

0 Answers0