Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 838 Bytes

README.md

File metadata and controls

36 lines (26 loc) · 838 Bytes

twodict (Two Way Ordered Dict)

Simple two way ordered dictionary for Python.

See wiki for more information.

INSTALLATION

Install From Source

  1. Download & extract source from here
  2. Change directory into twodict-1.2/
  3. Run sudo python setup.py install

Install From Pypi

  1. Run sudo pip install twodict

USAGE

from twodict import TwoWayOrderedDict

tdict = TwoWayOrderedDict()
tdict['a'] = 1
tdict['b'] = 2
tdict['c'] = 3

print(tdict['a'])  # Outputs 1
print(tdict[1])  # Outputs 'a'

del tdict[2]
print(tdict)  # TwoWayOrderedDict([('a', 1), ('c', 3)])

AUTHOR

Sotiris Papadopoulos

LICENSE

Unlicense (public domain)