ConstructorTemplate

Labs

class ConstructorTemplate

Description

A constructor: the template form of new T(), new T(1, 2), new T(p = 1) or new a.b().

type is the instantiated type: a classifier or a feature, or a feature chain (new a.b()). The arguments bind the type’s features, positionally in order or by name (KerML 7.4.9.4); a named argument pairs the feature with its value. Equality and hashing compare the type and the features by element_id, for the reason ReferenceTemplate gives, and the argument templates structurally.

Members defined in ConstructorTemplate (4 members)

arguments

RW

named_arguments

RW

type

RW

__hash__

Hash the type’s identity with the arguments.

Members inherited from ExpressionTemplate (13 members)

__add__

__bool__

Raise: a template is an expression tree, not a truth value.

__mod__

__mul__

__neg__

__pos__

__radd__

__rmod__

__rmul__

__rsub__

__rtruediv__

__sub__

__truediv__

Attributes

arguments: tuple[syside.experimental.expressions.ExpressionTemplate, ...] = None
named_arguments: tuple[tuple[syside.Feature, syside.experimental.expressions.ExpressionTemplate], ...] = None
type: syside.Classifier | syside.Feature | syside.experimental.expressions.FeatureChainTemplate = None

Methods

__hash__() → int

Hash the type’s identity with the arguments.

Used by