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.

Source Distribution

File details

Details for the file otomap-0.7921cba85c0c51a931e648ba2c29843f8320d5e7.tar.gz.

File metadata

File hashes

Hashes for otomap-0.7921cba85c0c51a931e648ba2c29843f8320d5e7.tar.gz
Algorithm Hash digest
SHA256 2ef87f5f358b1e129c9a6e20feb05294d77edb2ef8a5a4c6d8b2708c79715c7b
MD5 3fc6fcf1285876441f0b24744aa3912f
BLAKE2b-256 5474ef6b33fee216946b6c0124053f16ce7eb3e1a9f9a2d1ac6a85b90daf8fc4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page