``adjacent_to()``, ``difference()``, ``union()``, etc., were added to the
PG-specific range objects, bringing them in par with the standard
operators implemented by the underlying
- :attr:`_postgresql.AbstractRange.comparator_factory`. Pull request
- courtesy Lele Gaifax.
+ :attr:`_postgresql.AbstractRange.comparator_factory`.
+
+ In addition, the ``__bool__()_`` method of the class has been corrected to
+ be consistent with the common Python *containers* behavior as well as how
+ other popular PostgreSQL drivers do: it now tells whether the range
+ instance is *not* empty, rather than the other way around.
+
+ Pull request courtesy Lele Gaifax.
f"{r1} != {r2}: got {r1 != r2}, expected {different}",
)
+ def test_bool(self):
+ is_false(bool(Range(empty=True)))
+ is_true(bool(Range(1, 2)))
+
class _RangeTypeRoundTrip(_RangeComparisonFixtures, fixtures.TablesTest):
__requires__ = ("range_types",)