def force_convert(self):
if isinstance(self._value, float):
return self.float_class(str(self._value))
try:
return self.float_class(self._value)
except (TypeError, ValueError, decimal.InvalidOperation):
raise TypeConversionError(
"failed to force_convert to float: type={}".format(
type(self._value)))
评论列表
文章目录