def _validate(self, val):
        """
        Checks that the value is numeric and that it is within the hard
        bounds; if not, an exception is raised.
        """
        if self.allow_None and val is None:
            return

        if not isinstance(val, dt_types) and not (self.allow_None and val is None):
            raise ValueError("Date '%s' only takes datetime types."%self.name)

        if self.step is not None and not isinstance(self.step, dt_types):
            raise ValueError("Step parameter can only be None or a datetime type")

        self._checkBounds(val)
def _validate ( self , val ) : if self . allow_None and val is None : return if not isinstance ( val , dt_types ) and not ( self . allow_None and val is None ) : raise ValueError ( "Date '%s' only takes datetime types." % self . name ) if self . step is not None and not isinstance ( self . step , dt_types ) : raise ValueError ( "Step parameter can only be None or a datetime type" ) self . _checkBounds ( val )
Checks that the value is numeric and that it is within the hard
        bounds; if not, an exception is raised.