componenttools.get_first_instance_of_klass_in_proper_parentage_of_component

abjad.tools.componenttools.get_first_instance_of_klass_in_proper_parentage_of_component.get_first_instance_of_klass_in_proper_parentage_of_component(component, klass)[source]

New in version 1.1.

Get first instance of klass in proper parentage of component:

abjad> staff = Staff("c'8 d'8 e'8 f'8")
abjad> componenttools.get_first_instance_of_klass_in_proper_parentage_of_component(staff[0], Staff)
Staff{4}

Return component or none.

Changed in version 2.0: renamed componenttools.get_first() to componenttools.get_first_instance_of_klass_in_proper_parentage_of_component().

This Page