spannertools.is_component_with_spanner_attached

abjad.tools.spannertools.is_component_with_spanner_attached.is_component_with_spanner_attached(expr, klass=None)[source]

New in version 2.0.

True when expr is a component with spanner attached:

abjad> staff = Staff("c'8 d'8 e'8 f'8")
abjad> beam = spannertools.BeamSpanner(staff.leaves)
abjad> f(staff)
\new Staff {
    c'8 [
    d'8
    e'8
    f'8 ]
}
abjad> spannertools.is_component_with_spanner_attached(staff[0])
True

Otherwise false:

abjad> spannertools.is_component_with_spanner_attached(staff)
False

When klass is not none then true when expr is a component with a spanner of klass attached.

Return true or false.

This Page