Package moul :: Package file :: Module wdysini :: Class MinMax
[hide private]
[frames] | no frames]

Class MinMax



object --+    
         |    
 Constrain --+
             |
            MinMax
Known Subclasses:
VideoConstrain

Min / max constrain
>>> c = MinMax(1, 10)
>>> c(1, debug="name")
1
>>> c(10, debug="name")
10
>>> c(11, debug="name")
Traceback (most recent call last):
...
ConstrainError: name: 11 > max 10
>>> c(-1, debug="name")
Traceback (most recent call last):
...
ConstrainError: name: -1 < min 1
>>> c = MinMax(0, 1)
>>> c(0.5, debug="name")
0.5


Instance Methods [hide private]
  __init__(self, min, max)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __call__(self, value, debug="unknown")

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Class Variables [hide private]
  __slots__ = ('_min', '_max')
  _max = <member '_max' of 'MinMax' objects>
  _min = <member '_min' of 'MinMax' objects>

Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, min, max)
(Constructor)

 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: Constrain.__init__

__call__(self, value, debug="unknown")
(Call operator)

 
None
Overrides: Constrain.__call__

Class Variable Details [hide private]

__slots__

None
Value:
('_min', '_max')                                                       
      

_max

None
Value:
<member '_max' of 'MinMax' objects>                                    
      

_min

None
Value:
<member '_min' of 'MinMax' objects>