listtools.partition_elements_into_canonic_parts — Abjad v1.1.1 documentation

### Navigation

- index
- modules |
- next |
- previous |
- Project Abjad »
- Abjad v1.1.1 documentation »
- Abjad API »

# listtools.partition_elements_into_canonic_parts

`abjad.tools.listtools.` `partition_elements_into_canonic_parts`(l, direction='big-endian')

  Partition elements in l into canonic parts according to direction.

      abjad> listtools.partition_elements_into_canonic_parts(l)
      [(0,), (1,), (2,), (3,), (4,), (4, 1), (6,), (7,), (8,), (8, 1)]

      abjad> listtools.partition_elements_into_canonic_parts(l, direction = 'little-endian')
      [(0,), (1,), (2,), (3,), (4,), (1, 4), (6,), (7,), (8,), (1, 8)]

  Raise `TypeError` when l is not a list:

      abjad> listtools.partition_elements_into_canonic_parts('foo')
      TypeError

  Raise `ValueError` on noninteger elements in l:

      abjad> listtools.partition_elements_into_canonic_parts([Rational(1, 2), Rational(1, 2)])
      ValueError

### Navigation

- index
- modules |
- next |
- previous |
- Project Abjad »
- Abjad v1.1.1 documentation »
- Abjad API »