array_split.split.pad_with_none

array_split.split.pad_with_none(sequence, new_length)[source]

Returns sequence list end-padded with None elements so that the length of the returned list equals new_length.

Parameters:
  • sequence (iterable) – Return listified sequence which has been end-padded.
  • new_length (int) – The length of the returned list.
Return type:

list

Returns:

A list of length new_length.

Raises:

ValueError – if len(sequence) > new_length).