Use new-style classes everywhere

Related to #296242.

authorRémi Cardona <remi.cardona@free.fr>
changesetcb9c4e81d12f
branchdefault
phasepublic
hiddenno
parent revision#a20f5d2332a6 [test] Replace reduce() with sum()
child revision#c47e2682cf2f [py3k] import range from six.moves
files modified by this revision
fi.py
interfaces.py
# HG changeset patch
# User Rémi Cardona <remi.cardona@free.fr>
# Date 1423914802 -3600
# Sat Feb 14 12:53:22 2015 +0100
# Node ID cb9c4e81d12f27d966a2caf85d6ebac08874462a
# Parent a20f5d2332a6fca026e4001b2cf2cdd47c4caa6d
Use new-style classes everywhere

Related to #296242.

diff --git a/fi.py b/fi.py
@@ -25,11 +25,11 @@
1 
2  from logilab.constraint.distributors import AbstractDistributor
3  from logilab.constraint.propagation import (AbstractDomain, ConsistencyFailure,
4                                              AbstractConstraint)
5 
6 -class Interval:
7 +class Interval(object):
8      """representation of an interval
9      This class is used to give back results from a FiniteIntervalDomain
10      """
11      def __init__(self, start, end):
12          self._start = start
diff --git a/interfaces.py b/interfaces.py
@@ -15,11 +15,11 @@
13  #
14  # You should have received a copy of the GNU Lesser General Public License along
15  # with logilab-constraint. If not, see <http://www.gnu.org/licenses/>.
16  """Definition of interfaces"""
17 
18 -class ConstraintInterface:
19 +class ConstraintInterface(object):
20      """The interface that all constraints should implement"""
21      def isVariableRelevant(self, variable):
22          """Returns true if changes in the domaine of the variable
23          should trigger an evaluation of the constraint"""
24          raise NotImplementedError
@@ -38,11 +38,11 @@
25          raises ConsistencyFailure if the narrowing fails
26          Returns 1 if the constraint is entailed, and 0 otherwise"""
27          raise NotImplementedError
28 
29 
30 -class DomainInterface:
31 +class DomainInterface(object):
32      """The interface that all domains should implement"""
33 
34      def resetFlags(self):
35          """resets the hasChanged flag"""
36          raise NotImplementedError
@@ -63,11 +63,11 @@
37      def getValues(self):
38          """returns a tuple containing all the values in the domain
39          These values should not be modified!"""
40          raise NotImplementedError
41 
42 -class DistributorInterface:
43 +class DistributorInterface(object):
44      """The interface that all distributors should implement"""
45      def distribute(self, domains, verbose=0):
46          """domains is a dictionnary of variable -> Domain objects
47          This method returns a list of dictionnaries similar to the domain argument
48          This list should be a partition of the initial domains"""