Changes with this release:
-
The behavior of the comparison (
==
,!=
,<
,<=
,>
,>=
) andhash
operators for ClormPredicate
instance are changed to call the corresponding underlyingclingo.Symbol
operators. Previously these operators explicitly combined the Python representation of the individual field parameters.- This change provides a clearer semantics for the comparison operator.
Predicate
instances should be understood as providing a view ofclingo.Symbol
objects. - An important property is that now all
Predicate
instances will be comparable for all comparison operators. Previously this was not guaranteed as it depended on the types of the underlying Python object. For example, in Python1 < "foo"
will raise and exception because a comparison ofint
andstr
is undefined. - Warning: the sort ordering for Predicate instances will be different to previous versions of the library.
- This change provides a clearer semantics for the comparison operator.
-
The initializer for
BaseField
and its sub-classes has changed to separate thedefault
anddefault_factory
parameters. This is consistent with thefield()
function as well as existing libraries, such asdataclasses
.- Warning: while this changes the API it should not be noticeable to users because users should not be explicitly instantiating field instances. Instead the preferred approach is to use the
field()
function to specify default parameters.
- Warning: while this changes the API it should not be noticeable to users because users should not be explicitly instantiating field instances. Instead the preferred approach is to use the
Warning: this release changes some behavior of Clorm. While we would expect that this would not be noticeable for most users, nevertheless please test carefully before updating your dependencies.