data_structures module

class amulet.api.data_structures.Stack(initial_data=None)[source]

Bases: typing.Generic

Implementation of a Stack, but prevents out-of-order editing of stored data

clear()[source]

Clears all stored elements in the Stack

is_empty()[source]

Checks if the Stack is empty

Return type:bool
Returns:True is the Stack holds elements, False otherwise
peek()[source]

Returns the top element of the Stack without removing it

Return type:Optional[~T]
Returns:The top element of the Stack, None if the Stack is empty