[issue25879] Code objects from same line can compare equal

2015-12-15 Thread Kirk McDonald
Kirk McDonald added the comment: This is a duplicate of http://bugs.python.org/issue25843 -- resolution: -> duplicate status: open -> closed ___ Python tracker ___ _

[issue25879] Code objects from same line can compare equal

2015-12-15 Thread Kirk McDonald
Changes by Kirk McDonald : -- components: +Interpreter Core type: -> behavior versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker _

[issue25879] Code objects from same line can compare equal

2015-12-15 Thread Kirk McDonald
New submission from Kirk McDonald: The following code gives an unexpected result: >>> a, b = lambda: 1, lambda: 1.0 >>> a() 1 >>> b() 1 >>> type(b()) >>> a.__code__ is b.__code__ True The cause boils down to this line of code: https://hg.python.org/cpython/file/33ff335da34c/Objects/codeobject