FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(rut): Fix usage of NotImplemented in boolean context in Rut.__le__() · cordada/lib-cl-sii-python@d30e6cb · GitHub

Repository navigation

Commit d30e6cb

Browse files
committed
fix(rut): Fix usage of NotImplemented in boolean context in Rut.__le__()
Using `NotImplemented` in a boolean context has been deprecated since Python 3.9 and raises a `TypeError` since Python 3.14. Ref: python/cpython#118767
1 parent 99b4e3c commit d30e6cb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎src/cl_sii/rut/__init__.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ def __lt__(self, other: object) -> bool:
141141
return NotImplemented
142142

143143
def __le__(self, other: object) -> bool:
144-
return self.__lt__(other) or self.__eq__(other)
144+
if isinstance(other, Rut):
145+
return self.__lt__(other) or self.__eq__(other)
146+
else:
147+
return NotImplemented
145148

146149
def __eq__(self, other: object) -> bool:
147150
if isinstance(other, Rut):

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL