LinearMap

A simple implementation of a map using a list of tuples where each tuple is a key-value pair.

Methods

init

Parameters

namedescriptiondefault

self

add

Adds a new item that maps from key (k) to value (v). Assumes that they keys are unique.

Parameters

namedescriptiondefault

self

k

v

get

Looks up the key (k) and returns the corresponding value, or raises KeyError if the key is not found.

Parameters

namedescriptiondefault

self

k

Last updated