diff options
| author | Lele Gaifax <lele@metapensiero.it> | 2022-11-27 14:44:13 -0500 |
|---|---|---|
| committer | sqla-tester <sqla-tester@sqlalchemy.org> | 2022-11-27 14:44:13 -0500 |
| commit | 771a5d1a4b517fe56d79caf254e10c12024295ef (patch) | |
| tree | 818095108c18dc36fc601b9800303c19c805de76 /doc | |
| parent | db2344b0a2a9ef164651d645a8da2d7a9d1bc250 (diff) | |
| download | sqlalchemy-771a5d1a4b517fe56d79caf254e10c12024295ef.tar.gz | |
Rectify PG Range.__bool__, inverting previous logic
The boolness of the range was defined to be equal to its emptiness. As this has been identified as a typo rather than the intended, this inverts the logic, to match common Python behaviour as well as how other popular PG drivers do.
Closes: #8885
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8885
Pull-request-sha: 5670cdb920692a62f77b7b6ea312784033de83d9
Change-Id: I6f4a40168b2f037c578e84f7550370411bd42160
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/build/changelog/unreleased_20/8765.rst | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/doc/build/changelog/unreleased_20/8765.rst b/doc/build/changelog/unreleased_20/8765.rst index a210fb348..1f7fe144b 100644 --- a/doc/build/changelog/unreleased_20/8765.rst +++ b/doc/build/changelog/unreleased_20/8765.rst @@ -6,5 +6,11 @@ ``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. |
