sequencetools.all_are_nonnegative_integer_powers_of_two

abjad.tools.sequencetools.all_are_nonnegative_integer_powers_of_two.all_are_nonnegative_integer_powers_of_two(expr)[source]

New in version 2.0.

True when expr is a sequence and all elements in expr are nonnegative integer powers of two:

abjad> from abjad.tools import sequencetools
abjad> sequencetools.all_are_nonnegative_integer_powers_of_two([0, 1, 1, 1, 2, 4, 32, 32])
True

True when expr is an empty sequence:

abjad> sequencetools.all_are_nonnegative_integer_powers_of_two([])
True

False otherwise:

abjad> sequencetools.all_are_nonnegative_integer_powers_of_two(17)
False

Return boolean.

This Page