[issue39902] dis.Bytecode objects should be comparable

2020-03-08 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: Code objects themselves supports equality comparisons, >>> compile("print(1)", "", "eval") == compile("print(1)", "", >>> "eval") True So this patch basically compares the underlying code objects with 2 Bytecode specific attribute, first_line and

[issue39902] dis.Bytecode objects should be comparable

2020-03-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: What does it mean for two Bytecode objects to be equal? I know what equality means for ints: they have the same numeric value. I know what equality means for strings: they have the same sequence of Unicode code points. I have no concept of what it would

[issue39902] dis.Bytecode objects should be comparable

2020-03-08 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- keywords: +patch pull_requests: +18206 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18849 ___ Python tracker ___

[issue39902] dis.Bytecode objects should be comparable

2020-03-08 Thread Batuhan Taskaya
New submission from Batuhan Taskaya : import dis >>> dis.Bytecode("print(1)") == dis.Bytecode("print(1)") False -- components: Library (Lib) messages: 363656 nosy: BTaskaya priority: normal severity: normal status: open title: dis.Bytecode objects should be comparable type: enhancement