From c2d36054d19cee4c5f9185c0880f2bf626e8be05 Mon Sep 17 00:00:00 2001 From: Gary Hu <43922980+Gy-Hu@users.noreply.github.com> Date: Tue, 14 Apr 2026 11:09:19 +0800 Subject: [PATCH] Fix two bugs in Python examples - bincover.py: typo `NOne` -> `None` in _value2bin fallback path (would raise NameError if bin_index is out of range). - complex/complex.py: rename `__neq__` to `__ne__`. Python has no `__neq__` dunder, so `!=` was not using the intended definition. On Python 3 it silently fell back to the auto-derived inverse of `__eq__`; on Python 2 it fell back to identity comparison. --- examples/python/bincover.py | 2 +- examples/python/complex/complex.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/python/bincover.py b/examples/python/bincover.py index d8a81c25a..72b769982 100644 --- a/examples/python/bincover.py +++ b/examples/python/bincover.py @@ -195,7 +195,7 @@ class BinCoverSolver(UserPropagateBase): assert isinstance(value, BitVecNumRef) bin_index = value.as_long() if bin_index >= len(self.bins): - return NOne + return None return self.bins[bin_index] def _add_item2bin(self, item, bin): diff --git a/examples/python/complex/complex.py b/examples/python/complex/complex.py index aa9adeef8..051641808 100644 --- a/examples/python/complex/complex.py +++ b/examples/python/complex/complex.py @@ -81,7 +81,7 @@ class ComplexExpr: other = _to_complex(other) return And(self.r == other.r, self.i == other.i) - def __neq__(self, other): + def __ne__(self, other): return Not(self.__eq__(other)) def simplify(self):