OrderedDict
Dict where insertion order matters.
Constructor
Signature
def OrderedDict() - > null
Methods
move_to_end()
@classmethod
def move_to_end(
key: Any,
last: bool = True
) - > None
Moves an existing key to either the beginning or the end of the ordered dictionary.
Parameters
| Name | Type | Description |
|---|---|---|
| key | Any | The existing dictionary key to be relocated within the insertion order. |
| last | bool = True | A flag determining the destination; if True, the key is moved to the end, and if False, it is moved to the beginning. |
Returns
| Type | Description |
|---|---|
None | Nothing is returned; the dictionary is modified in-place. |