Open sveinse opened 2 years ago
In python, using the in operator is used to test for membership, thus it would be natural to expect that the following expression is valid to test if the given address is present in the hex. However it hangs of an unknown reason.
in
is_present = 0x1000 in ih
This has a trivial fix by implementing __contains__. I have implemented a fix and a test for it in my fork: https://github.com/sveinse/intelhex. Please give notice if a PR is wanted for this. https://github.com/sveinse/intelhex
__contains__
https://github.com/python-intelhex/intelhex/compare/master...sveinse:intelhex:master
Looks good for me. Thanks.
Please, create a pull request, so maintainer can easily merge this.
In python, using the
in
operator is used to test for membership, thus it would be natural to expect that the following expression is valid to test if the given address is present in the hex. However it hangs of an unknown reason.This has a trivial fix by implementing
__contains__
. I have implemented a fix and a test for it in my fork: https://github.com/sveinse/intelhex. Please give notice if a PR is wanted for this. https://github.com/sveinse/intelhexhttps://github.com/python-intelhex/intelhex/compare/master...sveinse:intelhex:master