'Coerce values (except None) to self.data_type.
Args:
value: The value to be validated and coerced.
Returns:
The coerced and validated value.  It is guaranteed that this is
either None or an instance of self.data_type; otherwise an exception
is raised.
Raises:
BadValueError if the value could not be validated or coerced.'

def validate(self, value):

    value = super(_CoercingProperty, self).validate(value)
    if ((value is not None) and (not isinstance(value, self.data_type))):
        value = self.data_type(value)
    return value
