Steven D'Aprano <[email protected]> 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 mean for two Bytecode objects to be equal or
unequal. Your patch compares the tuple:
(codeobj, first_line, current_offset)
but why do you compare those rather than, say, the source code, or the
disassembled byte code, or something else?
Before I read your patch, I guested that you would have defined `__eq__` as
`self.dis() == other.dis()`.
----------
nosy: +steven.daprano
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue39902>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com