[issue34100] Python doesn't intern integers in a tuple of constant literals

2018-07-11 Thread INADA Naoki
INADA Naoki added the comment: Thank you for finding it. I had worked on constant merging. [1] It didn't fix this case for now. I'll continue the suspended work. [1]: https://github.com/methane/cpython/pull/14/files But it may be a too big to fix only this regression. How is this regression

[issue34100] Python doesn't intern integers in a tuple of constant literals

2018-07-11 Thread STINNER Victor
STINNER Victor added the comment: Should the AST optimizer "interns" constants? -- ___ Python tracker ___ ___ Python-bugs-list mail

[issue34100] Python doesn't intern integers in a tuple of constant literals

2018-07-11 Thread Mark Dickinson
Mark Dickinson added the comment: This was a side-effect of #29469. -- nosy: +inada.naoki, mark.dickinson, serhiy.storchaka, vstinner ___ Python tracker ___ __

[issue34100] Python doesn't intern integers in a tuple of constant literals

2018-07-11 Thread Dan Rose
Dan Rose added the comment: Another curious case: a = (500,500); b = (500,500) print(a[0] is b[0]) # True print(a[0] is b[1]) # False print(a[1] is b[0]) # False print(a[1] is b[1]) # True -- ___ Python tracker

[issue34100] Python doesn't intern integers in a tuple of constant literals

2018-07-11 Thread Dan Rose
New submission from Dan Rose : In the Python 3.7.0 interpreter, the following evaluates to False. In 3.6.4, it was True: c,d = 500,500 c is d This seems to be because, in some cases, Python 3.7 fails to intern integers inside tuples: a = (500,500) print(a[0] is a[1]) # False