Pattern

abstract class supriya.tools.patterntools.Pattern[source]

Pattern base class.

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_builtins { graph [label=builtins]; "builtins.object" [color=1, group=0, label=object, shape=box]; } subgraph cluster_patterntools { graph [label=patterntools]; "supriya.tools.patterntools.EventPattern.EventPattern" [color=2, group=1, label=EventPattern, shape=oval, style=bold]; "supriya.tools.patterntools.Pattern.Pattern" [color=black, fontcolor=white, group=1, label=<<B>Pattern</B>>, shape=oval, style="filled, rounded"]; "supriya.tools.patterntools.Pbind.Pbind" [color=2, group=1, label=Pbind, shape=box]; "supriya.tools.patterntools.Pbindf.Pbindf" [color=2, group=1, label=Pbindf, shape=box]; "supriya.tools.patterntools.Pbinop.Pbinop" [color=2, group=1, label=Pbinop, shape=box]; "supriya.tools.patterntools.Pbus.Pbus" [color=2, group=1, label=Pbus, shape=box]; "supriya.tools.patterntools.Pchain.Pchain" [color=2, group=1, label=Pchain, shape=box]; "supriya.tools.patterntools.Pfx.Pfx" [color=2, group=1, label=Pfx, shape=box]; "supriya.tools.patterntools.Pgpar.Pgpar" [color=2, group=1, label=Pgpar, shape=box]; "supriya.tools.patterntools.Pgroup.Pgroup" [color=2, group=1, label=Pgroup, shape=box]; "supriya.tools.patterntools.Pmono.Pmono" [color=2, group=1, label=Pmono, shape=box]; "supriya.tools.patterntools.Pn.Pn" [color=2, group=1, label=Pn, shape=oval, style=bold]; "supriya.tools.patterntools.Ppar.Ppar" [color=2, group=1, label=Ppar, shape=box]; "supriya.tools.patterntools.Prand.Prand" [color=2, group=1, label=Prand, shape=box]; "supriya.tools.patterntools.Pseed.Pseed" [color=2, group=1, label=Pseed, shape=box]; "supriya.tools.patterntools.Pseq.Pseq" [color=2, group=1, label=Pseq, shape=box]; "supriya.tools.patterntools.Pwhite.Pwhite" [color=2, group=1, label=Pwhite, shape=box]; "supriya.tools.patterntools.EventPattern.EventPattern" -> "supriya.tools.patterntools.Pbind.Pbind"; "supriya.tools.patterntools.EventPattern.EventPattern" -> "supriya.tools.patterntools.Pbindf.Pbindf"; "supriya.tools.patterntools.EventPattern.EventPattern" -> "supriya.tools.patterntools.Pbus.Pbus"; "supriya.tools.patterntools.EventPattern.EventPattern" -> "supriya.tools.patterntools.Pchain.Pchain"; "supriya.tools.patterntools.EventPattern.EventPattern" -> "supriya.tools.patterntools.Pfx.Pfx"; "supriya.tools.patterntools.EventPattern.EventPattern" -> "supriya.tools.patterntools.Pgroup.Pgroup"; "supriya.tools.patterntools.EventPattern.EventPattern" -> "supriya.tools.patterntools.Ppar.Ppar"; "supriya.tools.patterntools.Pattern.Pattern" -> "supriya.tools.patterntools.EventPattern.EventPattern"; "supriya.tools.patterntools.Pattern.Pattern" -> "supriya.tools.patterntools.Pbinop.Pbinop"; "supriya.tools.patterntools.Pattern.Pattern" -> "supriya.tools.patterntools.Pn.Pn"; "supriya.tools.patterntools.Pattern.Pattern" -> "supriya.tools.patterntools.Pseed.Pseed"; "supriya.tools.patterntools.Pattern.Pattern" -> "supriya.tools.patterntools.Pseq.Pseq"; "supriya.tools.patterntools.Pattern.Pattern" -> "supriya.tools.patterntools.Pwhite.Pwhite"; "supriya.tools.patterntools.Pbind.Pbind" -> "supriya.tools.patterntools.Pmono.Pmono"; "supriya.tools.patterntools.Ppar.Ppar" -> "supriya.tools.patterntools.Pgpar.Pgpar"; "supriya.tools.patterntools.Pseq.Pseq" -> "supriya.tools.patterntools.Prand.Prand"; } subgraph cluster_systemtools { graph [label=systemtools]; "supriya.tools.systemtools.SupriyaObject.AbstractBase" [color=3, group=2, label=AbstractBase, shape=box]; "supriya.tools.systemtools.SupriyaObject.SupriyaObject" [color=3, group=2, label=SupriyaObject, shape=box]; "supriya.tools.systemtools.SupriyaValueObject.SupriyaValueObject" [color=3, group=2, label=SupriyaValueObject, shape=box]; "supriya.tools.systemtools.SupriyaObject.AbstractBase" -> "supriya.tools.systemtools.SupriyaObject.SupriyaObject"; "supriya.tools.systemtools.SupriyaObject.SupriyaObject" -> "supriya.tools.systemtools.SupriyaValueObject.SupriyaValueObject"; } "builtins.object" -> "supriya.tools.systemtools.SupriyaObject.AbstractBase"; "supriya.tools.systemtools.SupriyaValueObject.SupriyaValueObject" -> "supriya.tools.patterntools.Pattern.Pattern"; }

Bases

Attribute summary

arity
is_infinite
__add__(expr) Adds expr to pattern.
__copy__(*args)
__div__(expr)
__eq__(expr)
__format__([format_specification]) Formats Supriya object.
__hash__()
__iter__()
__mul__(expr)
__pow__(expr)
__radd__(expr)
__rdiv__(expr)
__repr__() Gets interpreter representation of Supriya object.
__rmul__(expr)
__rpow__(expr)
__rsub__(expr)
__sub__(expr)

Read-only properties

abstract Pattern.arity
abstract Pattern.is_infinite

Special methods

Pattern.__add__(expr)[source]

Adds expr to pattern.

>>> pattern = patterntools.Pseq([1, 2, 3])
>>> expr = patterntools.Pseq([0, 10])
>>> list(pattern + expr)
[1, 12]
>>> expr = 10
>>> list(pattern + expr)
[11, 12, 13]
>>> expr = [10, [100, 1000]]
>>> list(pattern + expr)
[[11, [101, 1001]], [12, [102, 1002]], [13, [103, 1003]]]
>>> pattern = patterntools.Pseq([[1, [2, 3]], [[4, 5], 6, 7]])
>>> expr = [10, [100, 1000]]
>>> for x in (pattern + expr):
...     x
...
[11, [102, 1003]]
[[14, 15], [106, 1006], 17]
(SupriyaValueObject).__copy__(*args)
Pattern.__div__(expr)[source]
(SupriyaValueObject).__eq__(expr)
(SupriyaObject).__format__(format_specification='')

Formats Supriya object.

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

Returns string.

(SupriyaValueObject).__hash__()
Pattern.__iter__()[source]
Pattern.__mul__(expr)[source]
Pattern.__pow__(expr)[source]
Pattern.__radd__(expr)[source]
Pattern.__rdiv__(expr)[source]
(SupriyaObject).__repr__()

Gets interpreter representation of Supriya object.

Returns string.

Pattern.__rmul__(expr)[source]
Pattern.__rpow__(expr)[source]
Pattern.__rsub__(expr)[source]
Pattern.__sub__(expr)[source]