collections Module

Data structures.

class wpull.collections.FrozenDict(orig_dict)[source]

Bases: collections.abc.Mapping, collections.abc.Hashable

Immutable mapping wrapper.

hash_cache
orig_dict
class wpull.collections.LinkedList[source]

Bases: object

Doubly linked list.

map

dict

A mapping of values to nodes.

head

LinkedListNode

The first node.

tail

LinkedListNode

The last node.

append(value)[source]
appendleft(value)[source]
clear()[source]
index(value)[source]
pop()[source]
popleft()[source]
remove(value)[source]
remove_node(node)[source]
class wpull.collections.LinkedListNode(value, head=None, tail=None)[source]

Bases: object

A node in a LinkedList.

value

Any value.

head

LinkedListNode

The node in front.

tail

LinkedListNode

The node in back.

head

Add a node to the head.

Add a node to the tail.

tail

Remove this node and link any head or tail.

value
class wpull.collections.OrderedDefaultDict(default_factory=None, *args, **kwargs)[source]

Bases: collections.OrderedDict

An ordered default dict.

http://stackoverflow.com/a/6190500/1524507

copy()[source]