TypedTuple

class datastructuretools.TypedTuple(items=None, item_class=None)

A typed tuple.

Lineage

digraph InheritanceGraph { graph [background=transparent, bgcolor=transparent, color=lightslategrey, fontname=Arial, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, root="__builtin__.object", splines=spline, style="dotted, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=12, penwidth=2, style="filled, rounded"]; edge [color=lightsteelblue2, penwidth=2]; subgraph cluster_abctools { graph [label=abctools]; "abjad.tools.abctools.AbjadObject.AbjadObject" [color=1, group=0, label=AbjadObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" [color=1, group=0, label=AbstractBase, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" -> "abjad.tools.abctools.AbjadObject.AbjadObject"; } subgraph cluster_datastructuretools { graph [label=datastructuretools]; "abjad.tools.datastructuretools.TypedCollection.TypedCollection" [color=3, group=2, label=TypedCollection, shape=oval, style=bold]; "abjad.tools.datastructuretools.TypedTuple.TypedTuple" [color=black, fontcolor=white, group=2, label=<<B>TypedTuple</B>>, shape=box, style="filled, rounded"]; "abjad.tools.datastructuretools.TypedCollection.TypedCollection" -> "abjad.tools.datastructuretools.TypedTuple.TypedTuple"; } subgraph cluster_patterntools { graph [label=patterntools]; "abjad.tools.patterntools.CompoundPattern.CompoundPattern" [color=4, group=3, label=CompoundPattern, shape=box]; "abjad.tools.patterntools.PatternInventory.PatternInventory" [color=4, group=3, label=PatternInventory, shape=box]; } subgraph cluster_pitchtools { graph [label=pitchtools]; "abjad.tools.pitchtools.IntervalClassSegment.IntervalClassSegment" [color=5, group=4, label=IntervalClassSegment, shape=box]; "abjad.tools.pitchtools.IntervalSegment.IntervalSegment" [color=5, group=4, label=IntervalSegment, shape=box]; "abjad.tools.pitchtools.PitchClassSegment.PitchClassSegment" [color=5, group=4, label=PitchClassSegment, shape=box]; "abjad.tools.pitchtools.PitchSegment.PitchSegment" [color=5, group=4, label=PitchSegment, shape=box]; "abjad.tools.pitchtools.Segment.Segment" [color=5, group=4, label=Segment, shape=oval, style=bold]; "abjad.tools.pitchtools.TwelveToneRow.TwelveToneRow" [color=5, group=4, label=TwelveToneRow, shape=box]; "abjad.tools.pitchtools.PitchClassSegment.PitchClassSegment" -> "abjad.tools.pitchtools.TwelveToneRow.TwelveToneRow"; "abjad.tools.pitchtools.Segment.Segment" -> "abjad.tools.pitchtools.IntervalClassSegment.IntervalClassSegment"; "abjad.tools.pitchtools.Segment.Segment" -> "abjad.tools.pitchtools.IntervalSegment.IntervalSegment"; "abjad.tools.pitchtools.Segment.Segment" -> "abjad.tools.pitchtools.PitchClassSegment.PitchClassSegment"; "abjad.tools.pitchtools.Segment.Segment" -> "abjad.tools.pitchtools.PitchSegment.PitchSegment"; } subgraph cluster_tonalanalysistools { graph [label=tonalanalysistools]; "abjad.tools.tonalanalysistools.RootlessChordClass.RootlessChordClass" [color=6, group=5, label=RootlessChordClass, shape=box]; "abjad.tools.tonalanalysistools.Scale.Scale" [color=6, group=5, label=Scale, shape=box]; } subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=2, group=1, label=object, shape=box]; } "abjad.tools.abctools.AbjadObject.AbjadObject" -> "abjad.tools.datastructuretools.TypedCollection.TypedCollection"; "abjad.tools.datastructuretools.TypedTuple.TypedTuple" -> "abjad.tools.patterntools.CompoundPattern.CompoundPattern"; "abjad.tools.datastructuretools.TypedTuple.TypedTuple" -> "abjad.tools.patterntools.PatternInventory.PatternInventory"; "abjad.tools.datastructuretools.TypedTuple.TypedTuple" -> "abjad.tools.pitchtools.Segment.Segment"; "abjad.tools.pitchtools.IntervalSegment.IntervalSegment" -> "abjad.tools.tonalanalysistools.RootlessChordClass.RootlessChordClass"; "abjad.tools.pitchtools.PitchClassSegment.PitchClassSegment" -> "abjad.tools.tonalanalysistools.Scale.Scale"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Bases

Attribute summary

count(item) Changes item to item.
index(item) Changes item to item.
item_class Item class to coerce items into.
items Gets collection items.
__add__(expr) Adds typed tuple to expr.
__contains__(item) Change item to item and return true if item exists in collection.
__eq__(expr) Is true when expr is a typed collection with items that compare equal to those of this typed collection.
__format__([format_specification]) Formats Abjad object.
__getitem__(i) Gets i from type tuple.
__getslice__(start, stop) Gets slice from start to stop in typed tuple.
__hash__() Hashes typed tuple.
__iter__() Iterates typed collection.
__len__() Length of typed collection.
__mul__(expr) Multiplies typed tuple by expr.
__ne__(expr) Is true when expr is not a typed collection with items equal to this typed collection.
__radd__(expr) Right-adds expr to typed tuple.
__repr__() Gets interpreter representation of Abjad object.
__rmul__(expr) Multiplies expr by typed tuple.

Read-only properties

(TypedCollection).item_class

Item class to coerce items into.

(TypedCollection).items

Gets collection items.

Methods

TypedTuple.count(item)

Changes item to item.

Returns count in collection.

TypedTuple.index(item)

Changes item to item.

Returns index in collection.

Special methods

TypedTuple.__add__(expr)

Adds typed tuple to expr.

Returns new typed tuple.

TypedTuple.__contains__(item)

Change item to item and return true if item exists in collection.

Returns none.

(TypedCollection).__eq__(expr)

Is true when expr is a typed collection with items that compare equal to those of this typed collection. Otherwise false.

Returns true or false.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

Set format_specification to ‘’ or ‘storage’. Interprets ‘’ equal to ‘storage’.

Returns string.

TypedTuple.__getitem__(i)

Gets i from type tuple.

Returns item.

TypedTuple.__getslice__(start, stop)

Gets slice from start to stop in typed tuple.

Returns new typed tuple.

TypedTuple.__hash__()

Hashes typed tuple.

Returns integer.

(TypedCollection).__iter__()

Iterates typed collection.

Returns generator.

(TypedCollection).__len__()

Length of typed collection.

Returns nonnegative integer.

TypedTuple.__mul__(expr)

Multiplies typed tuple by expr.

Returns new typed tuple.

(TypedCollection).__ne__(expr)

Is true when expr is not a typed collection with items equal to this typed collection. Otherwise false.

Returns true or false.

TypedTuple.__radd__(expr)

Right-adds expr to typed tuple.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.

TypedTuple.__rmul__(expr)

Multiplies expr by typed tuple.

Returns new typed tuple.