Pre-release
This release is a pre-release and may not be stable for production use.
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()
[]
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-1.cc5c453ebfbe00229f6e605f38fb5be824394996.tar.gz.
File metadata
- Download URL: otomap-1.cc5c453ebfbe00229f6e605f38fb5be824394996.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08fe964754b20b797aa3b66bf256db39b9842fd92b04777dba596eecd455d766
|
|
| MD5 |
0eaa1b74bc82ec9fcdff5a0d0f6a16a9
|
|
| BLAKE2b-256 |
9a700ea56d9b0989a5612c995b68f430789bf0b38ae826e5fb5678c681fcd793
|