syside.Annotations

class Annotations

Bases: ChildrenNodes[syside.Annotation, Element]

append(relationship: type[syside.Annotations.append.R], element: syside.Annotations.append.M, name: syside.NameID = ...) tuple[syside.Annotations.append.R, syside.Annotations.append.M]

Append a new owned or referenced element, inferred from the relationship type and this container. Returns a pair of (relationship, element), only the relationship is newly constructed.

replace(index: int, relationship: type[syside.Annotations.replace.R], element: syside.Annotations.replace.M, name: syside.NameID = ...) tuple[syside.Annotations.replace.R, syside.Annotations.replace.M]

Replace the relationship and its related element at the specified index. The relationship may be reused if its type matches the current relationship at that index. The related element may be owned or referenced depending on the relationship type and this container, see append for more details.

insert(index: int, relationship: type[syside.Annotations.insert.R], element: syside.Annotations.insert.M, name: syside.NameID = ...) tuple[syside.Annotations.insert.R, syside.Annotations.insert.M]

Insert a relationship and a related element at the specified index. The related element may be owned or referenced depending on the relationship type and this container, see append for more details.