parenttools.get_first

abjad.tools.parenttools.get_first(component, klass)

New in version 1.1.1.

Return first instance of klass in parentage of component.

abjad> staff = Staff(construct.scale(4))
abjad> parenttools.get_first(staff[0], Staff)
Staff{4}

Otherwise return None.

Previous topic

overridetools.promote

Next topic

parenttools.get_with_indices

This Page