  
      def __init__(self, field, value, errors, prefix=''):
          if value is None or value is '':
              value = {}
          super(NestedBoundField, self).__init__(field, value, errors, prefix)
  
      def __iter__(self):
          for field in self.fields.values():
              yield self[field.field_name]
  
 
</s> remove         if value is None or value is '':
 </s> add         if value is None or value == '': </s> remove         ))
 </s> add         ) </s> remove     class Option(object):
 </s> add     class Option: </s> remove         if output_format is None or isinstance(value, six.string_types):
 </s> add         if output_format is None or isinstance(value, str): </s> remove             if isinstance(value, six.text_type):
 </s> add             if isinstance(value, str):
        super().__init__(field, value, errors, prefix)
  
      def __init__(self, field, value, errors, prefix=''):
          if value is None or value is '':
              value = {}
        super().__init__(field, value, errors, prefix)
  
      def __iter__(self):
          for field in self.fields.values():
              yield self[field.field_name]
  
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/utils/serializer_helpers.py