Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

1:1 mapping collection type

Project description

This is a python module that implements a 1:1 mapping type - similar to a dict, but as well as looking up values by keys (m[k] -> v), you can look up keys by values (m[v] -> k).

Given m = OneToOneMap(), the following constraints are always true:

m.get(key) == value
m.get(value) == key

m.keys() == set(m.keys())
m.values() == set(m.values())
set(m.keys()) & set(m.values()) == set()
set.(m.keys()).isdisjoint(set(m.values())) == True

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
onetoonemap-1.0.0.tar.gz (2.0 kB) Copy SHA256 hash SHA256 Source None Dec 30, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page