X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=collect%2Fbidict.py;h=d28817453775e6f4dc35804a445dc2f6a9915bc4;hb=2f5b47c8b30d1b7d86443391332be2f3805cdafd;hp=1fa66dc81fe6bd64e16b80a8fa49bea7502c46db;hpb=fa4298fa508e00759565c246aef423ba28fedf31;p=python_utils.git diff --git a/collect/bidict.py b/collect/bidict.py index 1fa66dc..d288174 100644 --- a/collect/bidict.py +++ b/collect/bidict.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 -class bidict(dict): + +class BiDict(dict): def __init__(self, *args, **kwargs): """ A class that stores both a Mapping between keys and values and @@ -9,7 +10,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 +51,5 @@ class bidict(dict): if __name__ == '__main__': import doctest + doctest.testmod()