dsc/bunch — pull request #4 by dsuch (2012-02-22 22:00:31+00:00)
Title: Made __contains__ correctly handle keys like None, True, False and similar

Hi David,

can you please merge it in? It lets one use None, True and similar things as bunch keys which is what regular dictionaries allow one to do as well. Without the change the __contains__ method incorrectly reports that such a key doesn't exist in a Bunch instance, like below.

Cheers!

>>> from bunch import Bunch
>>> b = Bunch({None:123})
>>> None in b
False
>>> None in b.keys()
True
>>>
>>> d = {None:456}
>>> None in d
True
>>> None in d.keys()
True
>>>