forked from micropython/micropython
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
py/objboundmeth: Implement equality comparisons
Currently different bound method instances will compare as unequal even when both instances bind the same method and object. This is different to the CPython implementation and, for example, will cause problems when working with lists that contain callbacks since things like list.remove() will not work correctly. Fix this the obvious way by introducing a binary op and implementing MP_BINARY_OP_EQUAL. A simple test case is provided. Currently this is unconditionally compiled and on a Thumb2 system (ports/nrf) it resulted in a 68 byte increase in code size. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
- Loading branch information
1 parent
b442d82
commit d198d29
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters