Since this thing is on the innerwebs I suppose it should have a
[python_utils.git] / collect / bidict.py
index 1fa66dc81fe6bd64e16b80a8fa49bea7502c46db..375721e4a2652564ddfe42c6dc61925f8c7b4a76 100644 (file)
@@ -1,6 +1,11 @@
 #!/usr/bin/env python3
 
-class bidict(dict):
+# © Copyright 2021-2022, Scott Gasch
+
+"""Bidirectional Dictionary."""
+
+
+class BiDict(dict):
     def __init__(self, *args, **kwargs):
         """
         A class that stores both a Mapping between keys and values and
@@ -9,7 +14,7 @@ class bidict(dict):
         is possible to have several keys with the same value, using
         the inverse map returns a sequence of keys.
 
-        >>> d = bidict()
+        >>> d = BiDict()
         >>> d['a'] = 1
         >>> d['b'] = 2
         >>> d['c'] = 2
@@ -50,4 +55,5 @@ class bidict(dict):
 
 if __name__ == '__main__':
     import doctest
+
     doctest.testmod()