This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients BTaskaya, steven.daprano
Date 2020-03-08.13:32:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583674350.25.0.76625010243.issue39902@roundup.psfhosted.org>
In-reply-to
Content
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()`.
History
Date User Action Args
2020-03-08 13:32:30steven.dapranosetrecipients: + steven.daprano, BTaskaya
2020-03-08 13:32:30steven.dapranosetmessageid: <1583674350.25.0.76625010243.issue39902@roundup.psfhosted.org>
2020-03-08 13:32:30steven.dapranolinkissue39902 messages
2020-03-08 13:32:30steven.dapranocreate