          This hook is required for bulk update.
          It is used to determine the canonical identity of a given object.
          """
          try:
              return data.get('id', None)
          except AttributeError:
              return None
  
 
</s> remove         return data.get('id')
 </s> add         try:
            return data.get('id', None)
        except AttributeError:
            return None </s> remove                             try:
                                identity = self.get_identity(item)
                            except:
                                self.object = None
                            else:
                                self.object = identity_to_objects.pop(identity, None)
 </s> add                             identity = self.get_identity(item)
                            self.object = identity_to_objects.pop(identity, None) </s> remove         if self._deleted:
 </s> add         if self.allow_delete and self._deleted: </s> remove                 try:
                    iter(data)
                    if isinstance(data, dict):
                        raise TypeError
                except TypeError:
                    self._errors = {'non_field_errors': ['Expected a list of items']}
                else:
 </s> add                 if hasattr(data, '__iter__') and not isinstance(data, (dict, six.text_type)):
        Note that the data has not been validated at this point, so we need
        to make sure that we catch any cases of incorrect datatypes being
        passed to this method.
          This hook is required for bulk update.
          It is used to determine the canonical identity of a given object.
        Note that the data has not been validated at this point, so we need
        to make sure that we catch any cases of incorrect datatypes being
        passed to this method.
          """
          try:
              return data.get('id', None)
          except AttributeError:
              return None
  
keep add keep keep keep keep keep keep
 Bit of extra tidying and plenty of docs 
rest_framework/serializers.py