          # Map the string representation of choices to the underlying value.
          # Allows us to deal with eg. integer choices while supporting either
          # integer or string input, but still get the correct datatype out.
          self.choice_strings_to_values = {
              six.text_type(key): key for key in self.choices
          }
  
      choices = property(_get_choices, _set_choices)
  
  
 
</s> remove def unicode_repr(instance):
    # Get the repr of an instance, but ensure it is a unicode string
    # on both python 3 (already the case) and 2 (not the case).
    if six.PY2:
        return repr(instance).decode('utf-8')
    return repr(instance)


def unicode_to_repr(value):
    # Coerce a unicode string to the correct repr return type, depending on
    # the Python version. We wrap all our `__repr__` implementations with
    # this and then use unicode throughout internally.
    if six.PY2:
        return value.encode('utf-8')
    return value


 </s> add  </s> remove         @python_2_unicode_compatible
        class MockLazyStr(object):
 </s> add         class MockLazyStr: </s> remove @python_2_unicode_compatible
class PKOnlyObject(object):
 </s> add class PKOnlyObject: </s> remove         if data == '' or (self.trim_whitespace and six.text_type(data).strip() == ''):
 </s> add         if data == '' or (self.trim_whitespace and str(data).strip() == ''): </s> remove         ret = super(Serializer, self).data
 </s> add         ret = super().data
            str(key): key for key in self.choices
          # Map the string representation of choices to the underlying value.
          # Allows us to deal with eg. integer choices while supporting either
          # integer or string input, but still get the correct datatype out.
          self.choice_strings_to_values = {
            str(key): key for key in self.choices
          }
  
      choices = property(_get_choices, _set_choices)
  
  
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