              raise TypeError("%s is not a legal index" % index)
  
          # calculate new length and dimensions
          origLen = len(self)
          if isinstance(index, six.integer_types):
              index = self._checkindex(index)
              indexRange = [index]
          else:
              indexRange = range(*index.indices(origLen))
  
 
</s> remove         if not isinstance(index, six.integer_types + (slice,)):
 </s> add         if not isinstance(index, (int, slice)): </s> remove         if not isinstance(index, six.integer_types):
 </s> add         if not isinstance(index, int): </s> remove         if isinstance(index, six.string_types):
 </s> add         if isinstance(index, str): </s> remove         if isinstance(index, six.string_types):
 </s> add         if isinstance(index, str): </s> remove         if isinstance(index, six.integer_types):
 </s> add         if isinstance(index, int):
        if isinstance(index, int):
              raise TypeError("%s is not a legal index" % index)
  
          # calculate new length and dimensions
          origLen = len(self)
        if isinstance(index, int):
              index = self._checkindex(index)
              indexRange = [index]
          else:
              indexRange = range(*index.indices(origLen))
  
keep keep keep keep replace keep keep keep keep keep
 Refs #23919 -- Removed six.<various>_types usage

Thanks Tim Graham and Simon Charette for the reviews. 
django/contrib/gis/geos/mutable_list.py