diff options
| author | Peter LaFosse <peter@vector35.com> | 2021-10-08 17:26:12 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2021-10-08 17:26:28 -0400 |
| commit | e319e92dc54f3dae18b87c2ba53c503b80ad7354 (patch) | |
| tree | da99a301a4ac458c49926b2b3e851db45005c9ed /python/variable.py | |
| parent | 38fafa6e1dc5b5aade628b01a61d97f687e1a047 (diff) | |
Add __contains__ to AddressRange
Diffstat (limited to 'python/variable.py')
| -rw-r--r-- | python/variable.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/python/variable.py b/python/variable.py index 3af779a5..d345e4b0 100644 --- a/python/variable.py +++ b/python/variable.py @@ -798,4 +798,7 @@ class AddressRange: end:int # Exclusive ending address def __repr__(self): - return f"<{self.start:#x}-{self.end:#x}>"
\ No newline at end of file + return f"<{self.start:#x}-{self.end:#x}>" + + def __contains__(self, i:int): + return i >= self.start and i < self.end
\ No newline at end of file |
