class documentation
class PositionalList(_DoublyLinkedBase):
A sequential container of elements allowing positional access.
| Class | |
An abstraction representing the location of a single element. |
| Method | __iter__ |
Generate a forward iteration of the elements of the list. |
| Method | add |
Insert element e into list after Position p and return new Position. |
| Method | add |
Insert element e into list before Position p and return new Position. |
| Method | add |
Insert element e at the front of the list and return new Position. |
| Method | add |
Insert element e at the back of the list and return new Position. |
| Method | after |
Return the Position just after Position p (or None if p is last). |
| Method | before |
Return the Position just before Position p (or None if p is first). |
| Method | delete |
Remove and return the element at Position p. |
| Method | first |
Return the first Position in the list (or None if list is empty). |
| Method | last |
Return the last Position in the list (or None if list is empty). |
| Method | replace |
Replace the element at Position p with e. |
| Method | _insert |
Add element between existing nodes and return new Position. |
| Method | _make |
Return Position instance for given node (or None if sentinel). |
| Method | _validate |
Return position's node, or raise appropriate error if invalid. |
Inherited from _DoublyLinkedBase:
| Method | __init__ |
Create an empty list. |
| Method | __len__ |
Return the number of elements in the list. |
| Method | is |
Return True if list is empty. |
| Class | _ |
Lightweight, nonpublic class for storing a doubly linked node. |
| Method | _delete |
Delete nonsentinel node from the list and return its element. |
| Instance Variable | _header |
Undocumented |
| Instance Variable | _size |
Undocumented |
| Instance Variable | _trailer |
Undocumented |