code: def _fix_value(self, value):
          
          try:
              return self._castfunc(value)
          except:
              error = "Can't put '{0}' ({1}) into a {2}. Expected a {3} object."
              error = error.format(
                  value,                  # Input value
                  type(value),            # Type of input value
                  type(self),             # Type of collection
                  self._type              # Expected type of input value
              )
              six.reraise(TypeError, TypeError(error), sys.exc_info()[-1])
docs: Attempt to coerce value into the correct type.
  
          Subclasses can override this function.