Skip to main content

One-to-One mapping with MutableSet interface and directional MutableMapping facets.

Project description

otomap provides a one-to-one mapping abstraction, presented with a MutableSet interface of (left, right) entries. An OTOMap instance also has left and right facet attributes which both provide MutableMapping interfaces with complementary directionality.

Examples

>>> from otomap import OTOMap
>>> oto = OTOMap()
>>> oto.add(('foo', 'bar'))
>>> ('foo', 'bar') in oto
True
>>> list(oto)
[('foo', 'bar')]
>>> oto.left['foo']
'bar'
>>> oto.right['bar']
'foo'
>>> oto.left['X'] = 'bar'
>>> list(oto)
[('X', 'bar')]
>>> del oto.right['bar']
>>> oto.left.items()
[]

Project details


Download files

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

Files for otomap, version 1.cc5c453ebfbe00229f6e605f38fb5be824394996
Filename, size File type Python version Upload date Hashes
Filename, size otomap-1.cc5c453ebfbe00229f6e605f38fb5be824394996.tar.gz (4.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page