are useful when creating custom types that have some highly
idiosyncratic behavior on the SQL side.
+.. note:: The :meth:`.hybrid_property.comparator` decorator introduced
+ in this section **replaces** the use of the
+ :meth:`.hybrid_property.expression` decorator. They cannot be used together.
+
The example class below allows case-insensitive comparisons on the attribute
named ``word_insensitive``::
The return value of the decorated method should be an instance of
:class:`~.hybrid.Comparator`.
+ .. note:: The :meth:`.hybrid_property.comparator` decorator
+ **replaces** the use of the :meth:`.hybrid_property.expression`
+ decorator. They cannot be used together.
+
When a hybrid is invoked at the class level, the
:class:`~.hybrid.Comparator` object given here is wrapped inside of a
specialized :class:`.QueryableAttribute`, which is the same kind of