Open webartifex opened 3 weeks ago
one and zero are singletons. Yet, the following does not work with pytest in Python 3.9 and 3.10:
one
zero
def __eq__(self, other: object) -> bool: try: other = GF2Element(other) except (TypeError, ValueError): return False else: return self is other
return self is other is always False, even if a test case compares, for example, one to one or a one-like other.
return self is other
False
other
For now, use the following fix: return int(self) == int(other)
return int(self) == int(other)
This issue has no high priority because it only appears in pytest for older Python versions.
Without the temporary fix above, the following GitHub actions don't run successfully:
one
andzero
are singletons. Yet, the following does not work with pytest in Python 3.9 and 3.10:return self is other
is alwaysFalse
, even if a test case compares, for example,one
toone
or aone
-likeother
.For now, use the following fix:
return int(self) == int(other)
This issue has no high priority because it only appears in pytest for older Python versions.