                  MinValueValidator(self.min_value, message=message))
  
      def to_internal_value(self, data):
  
          if isinstance(data, six.text_type) and len(data) > self.MAX_STRING_LENGTH:
              self.fail('max_string_length')
  
          try:
              return float(data)
          except (TypeError, ValueError):
 
</s> remove                 self.error_messages['min_value'].format,
                six.text_type)(min_value=self.min_value)
 </s> add                 self.error_messages['min_value'].format, str)(min_value=self.min_value) </s> remove         if isinstance(data, six.text_type) or not hasattr(data, '__iter__'):
 </s> add         if isinstance(data, str) or not hasattr(data, '__iter__'): </s> remove         super(SlugRelatedField, self).__init__(**kwargs)
 </s> add         super().__init__(**kwargs) </s> remove                 self.error_messages['max_length'].format,
                six.text_type)(max_length=self.max_length)
 </s> add                 self.error_messages['max_length'].format, str)(max_length=self.max_length) </s> remove         if isinstance(data, bool) or not isinstance(data, six.string_types + six.integer_types + (float,)):
 </s> add         if isinstance(data, bool) or not isinstance(data, (str, int, float,)):
        if isinstance(data, str) and len(data) > self.MAX_STRING_LENGTH:
                  MinValueValidator(self.min_value, message=message))
  
      def to_internal_value(self, data):
  
        if isinstance(data, str) and len(data) > self.MAX_STRING_LENGTH:
              self.fail('max_string_length')
  
          try:
              return float(data)
          except (TypeError, ValueError):
keep keep keep keep replace keep keep keep keep keep
 Dropped Python 2 compatibility. (#6615)

Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com> 
rest_framework/fields.py