code: def _len_slice(obj):
      '''Slice length.
      '''
      try:
          return ((obj.stop - obj.start + 1) // obj.step)
      except (AttributeError, TypeError):
          return f _len_slice(obj):
      '''Slice length.
      '''
      try:
          return ((obj.stop - obj.start + 1) // obj.step)
      except (AttributeError, TypeError):
          return 0
docs: Slice length.