Skip to main content

ImmutableList

A tuple-like object that raises useful errors when it is asked to mutate.

Attributes

AttributeTypeDescription
warningstring = ImmutableList object is immutable.The error message string used when raising an AttributeError upon any attempt to mutate the list.

Methods


complain()

@classmethod
def complain(
*args: any,
**kwargs: any
) - > null

Raises an AttributeError containing the instance's custom warning message to prevent mutation.

Parameters

NameTypeDescription
*argsanyPositional arguments accepted to match the signature of the mutation method being blocked.
**kwargsanyKeyword arguments accepted to match the signature of the mutation method being blocked.

Returns

TypeDescription
nullThis method never returns as it always raises an AttributeError.