Skip to content

Version 1.6.0 release

Latest
Compare
Choose a tag to compare
@daveraja daveraja released this 09 May 10:53

Changes with this release:

  • The behavior of the comparison (==, !=, <, <=, >, >=) and hash operators for Clorm Predicate instance are changed to call the corresponding underlying clingo.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 of clingo.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 Python 1 < "foo" will raise and exception because a comparison of int and str is undefined.
    • Warning: the sort ordering for Predicate instances will be different to previous versions of the library.
  • The initializer for BaseField and its sub-classes has changed to separate the default and default_factory parameters. This is consistent with the field() function as well as existing libraries, such as dataclasses.

    • 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: 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.