diff --git a/contrib/pyln-client/pyln/client/lightning.py b/contrib/pyln-client/pyln/client/lightning.py index a81c930b5..d65640256 100644 --- a/contrib/pyln-client/pyln/client/lightning.py +++ b/contrib/pyln-client/pyln/client/lightning.py @@ -163,9 +163,13 @@ class Millisatoshi: return self.millisatoshis def __lt__(self, other: 'Millisatoshi') -> bool: + if isinstance(other, int): + return self.millisatoshis < other return self.millisatoshis < other.millisatoshis def __le__(self, other: 'Millisatoshi') -> bool: + if isinstance(other, int): + return self.millisatoshis <= other return self.millisatoshis <= other.millisatoshis def __eq__(self, other: object) -> bool: @@ -177,9 +181,13 @@ class Millisatoshi: return False def __gt__(self, other: 'Millisatoshi') -> bool: + if isinstance(other, int): + return self.millisatoshis > other return self.millisatoshis > other.millisatoshis def __ge__(self, other: 'Millisatoshi') -> bool: + if isinstance(other, int): + return self.millisatoshis >= other return self.millisatoshis >= other.millisatoshis def __add__(self, other: 'Millisatoshi') -> 'Millisatoshi':