1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 """Special operator class which returns a constant value."""
19 __revision__ = "$Id: Const.py,v 1.15 2010-10-29 19:24:41 rliebscher Exp $"
20
21 from fuzzy.operator.Operator import Operator
22
24 """Special operator which returns a constant value.
25
26 @ivar value: value returned at call of __call__().
27 @type value: float
28 """
29
31 """Constructor.
32
33 @param value: value returned at call of __call__().
34 @type value: float
35 """
36 super(Const, self).__init__()
37 self.value = value
38
40 """Return stored constant value."""
41 return self.value
42
44 """Return representation of instance.
45
46 @return: representation of instance
47 @rtype: string
48 """
49 return "%s.%s(%s)" % (self.__class__.__module__, self.__class__.__name__, self.value)
50