]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Merge "Add value-level hooks for SQL type detection; apply to Range" into main
authormike bayer <mike_mp@zzzcomputing.com>
Tue, 29 Nov 2022 23:35:16 +0000 (23:35 +0000)
committerGerrit Code Review <gerrit@ci3.zzzcomputing.com>
Tue, 29 Nov 2022 23:35:16 +0000 (23:35 +0000)
1  2 
lib/sqlalchemy/dialects/postgresql/ranges.py
lib/sqlalchemy/sql/sqltypes.py

index b1f418e415ba27901925b05c21b94fb6baad6b32,6f13d462ad28349f997f9f457a01b2a5bb33412c..e772777bf31c5090b065b93d639f3272dce8abdf
@@@ -82,8 -83,12 +83,12 @@@ class Range(Generic[_T])
              )
  
      def __bool__(self) -> bool:
 -        return self.empty
 +        return not self.empty
  
+     @property
+     def __sa_type_engine__(self):
+         return AbstractRange()
      def _contains_value(self, value: _T) -> bool:
          "Check whether this range contains the given `value`."
  
Simple merge