ConstraintListΒΆ

class ConstraintListΒΆ

List-like container of Constraint objects.

Methods

__init__

__init__

append

Append a constraint to the end of the list.

clear

Remove all constraints from the list.

copy

Return a shallow copy of the constraint list.

count

Return the number of occurrences of a constraint in the list.

extend

Extend the list with constraints from a sequence.

index

Return the index of the first occurrence of a constraint.

insert

Insert a constraint at a given position.

pop

Remove and return a constraint.

remove

Remove the first matching constraint from the list.

reverse

Reverse the constraint list in place.

class IteratorΒΆ
__init__(*args, **kwargs)ΒΆ
__iter__(self) IteratorΒΆ

__iter__

Return type:

Iterator

__next__(self) ConstraintΒΆ

__next__

Return type:

Constraint

__add__(self, arg: ConstraintList, /) ConstraintListΒΆ
__add__(self, arg: Constraint, /) ConstraintList

__add__

Overload 1.

Args:
  • arg (amplify.ConstraintList)

Returns:

amplify.ConstraintList:

Overload 2.

Args:
  • arg (amplify.Constraint)

Returns:

amplify.ConstraintList:

__copy__(self) ConstraintListΒΆ

__copy__

Return type:

ConstraintList

__deepcopy__(self, memo: object | None = None) ConstraintListΒΆ

__deepcopy__

Parameters:

memo (object | None) – Defaults to None.

Return type:

ConstraintList

__eq__(self, arg: object, /) boolΒΆ

__eq__

Parameters:

arg (object)

Return type:

bool

__getitem__(self, key: int) ConstraintΒΆ

__getitem__

Parameters:

key (int)

Return type:

Constraint

__iadd__(self, arg: ConstraintList, /) ConstraintListΒΆ
__iadd__(self, arg: Constraint, /) ConstraintList

__iadd__

Overload 1.

Args:
  • arg (amplify.ConstraintList)

Returns:

amplify.ConstraintList:

Overload 2.

Args:
  • arg (amplify.Constraint)

Returns:

amplify.ConstraintList:

__imul__(self, arg: float, /) ConstraintListΒΆ

__imul__

Parameters:

arg (float)

Return type:

ConstraintList

__init__(self) NoneΒΆ
__init__(self, arg: Sequence[Constraint]) None
__init__(self, arg: Iterable[Constraint]) None

__init__

Overload 2.

Args:
  • arg (collections.abc.Sequence[amplify.Constraint])

Overload 3.

Args:
  • arg (collections.abc.Iterable[amplify.Constraint])

__iter__(self) IteratorΒΆ

__iter__

Return type:

Iterator

__itruediv__(self, arg: float, /) ConstraintListΒΆ

__itruediv__

Parameters:

arg (float)

Return type:

ConstraintList

__len__(self) intΒΆ

Number of constraints in the list.

Return type:

int

__mul__(self, arg: float, /) ConstraintListΒΆ

__mul__

Parameters:

arg (float)

Return type:

ConstraintList

__ne__(self, arg: object, /) boolΒΆ

__ne__

Parameters:

arg (object)

Return type:

bool

__radd__(self, arg: Constraint, /) ConstraintListΒΆ
__radd__(self, arg: int, /) ConstraintList

__radd__

Overload 1.

Args:
  • arg (amplify.Constraint)

Returns:

amplify.ConstraintList:

Overload 2.

Args:
  • arg (int)

Returns:

amplify.ConstraintList:

__repr__(self) strΒΆ

__repr__

Return type:

str

__rmul__(self, arg: float, /) ConstraintListΒΆ

__rmul__

Parameters:

arg (float)

Return type:

ConstraintList

__setitem__(self, key: int, value: Constraint) NoneΒΆ

__setitem__

Parameters:
__str__(self) strΒΆ

__str__

Return type:

str

__truediv__(self, arg: float, /) ConstraintListΒΆ

__truediv__

Parameters:

arg (float)

Return type:

ConstraintList

append(self, value: Constraint) NoneΒΆ

Append a constraint to the end of the list.

Parameters:

value (Constraint)

clear(self) NoneΒΆ

Remove all constraints from the list.

copy(self) ConstraintListΒΆ

Return a shallow copy of the constraint list.

Return type:

ConstraintList

count(self, value: Constraint) intΒΆ

Return the number of occurrences of a constraint in the list.

Parameters:

value (Constraint) – Constraint to count.

Returns:

Number of occurrences.

Return type:

int

extend(self, sequence: Sequence[Constraint]) NoneΒΆ

Extend the list with constraints from a sequence.

Parameters:

sequence (Sequence[Constraint])

index(self, value: Constraint) intΒΆ
index(self, value: Constraint, start: int) int
index(self, value: Constraint, start: int, end: int) int

Return the index of the first occurrence of a constraint. index index

Overload 1.

Args:
  • value (amplify.Constraint): Constraint to find.

Returns:

int: Index of the first match.

Overload 2.

Args:
  • value (amplify.Constraint): Constraint to find.

  • start (int): Start index.

Returns:

int: Index of the first match.

Overload 3.

Args:
  • value (amplify.Constraint): Constraint to find.

  • start (int): Start index.

  • end (int): End index.

Returns:

int: Index of the first match.

insert(self, index: int, value: Constraint) NoneΒΆ

Insert a constraint at a given position.

Parameters:
pop(self, index: int | None = None) ConstraintΒΆ

Remove and return a constraint.

Parameters:

index (int | None) – Index to pop. If omitted, pop the last item. Defaults to None.

Returns:

Popped constraint.

Return type:

Constraint

remove(self, value: Constraint) NoneΒΆ

Remove the first matching constraint from the list.

Parameters:

value (Constraint)

reverse(self) NoneΒΆ

Reverse the constraint list in place.