# pydicom.sequence.Sequence

class pydicom.sequence.Sequence(iterable: Iterable[Dataset] | None = None)

  Class to hold multiple `Dataset` in a `list`.

  __init__(iterable: Iterable[Dataset] | None = None) → None

    Initialize a list of `Dataset`.

    Parameters:

      iterable (Iterable[Dataset] | None) – An iterable object (e.g. `list`, `tuple`) containing `Dataset`. If not used then an empty `Sequence` is generated.

  Methods

  `__init__`([iterable]) | Initialize a list of `Dataset`.
  `append`(item) | Append an item.
  `clear`() |
  `count`(value) |
  `extend`(val) | Extend the `Sequence` using an iterable of `Dataset` instances.
  `index`(value, [start, [stop]]) | Raises ValueError if the value is not present.
  `insert`(position, item) | Insert an item at position.
  `pop`([index]) | Raise IndexError if list is empty or index is out of range.
  `remove`(value) | S.remove(value) -- remove first occurrence of value.
  `reverse`() | S.reverse() -- reverse IN PLACE

  append(item: T) → None

    Append an item.

  clear() → None -- remove all items from S
  count(value) → integer -- return number of occurrences of value
  extend(val: Iterable[Dataset]) → None

    Extend the `Sequence` using an iterable of `Dataset` instances.

  index(value[, start[, stop]]) → integer -- return first index of value.

    Raises ValueError if the value is not present.

    Supporting start and stop arguments is optional, but recommended.

  insert(position: int, item: T) → None

    Insert an item at position.

  pop([index]) → item -- remove and return item at index (default last).

    Raise IndexError if list is empty or index is out of range.

  remove(value)

    S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.

  reverse()

    S.reverse() – reverse IN PLACE