Careful here:

get() will return the value if the key is there. In this case, it's not, so it returns None, the bool value of which is False, so it appears to work. And if the key is there, and the hvalue is something that evaluates True, then it will also work. But if teh key is there, but the value evaluates False, you'll get the wroing answer:

In [11]: d = {'cake': 0}

In [12]: bool(d.get('cake'))
Out[12]: False

Better to directly as for what you want to know: "is 'cake' in the dict?":

In [13]: 'cake' in d
Out[13]: True

In [14]: 'something' in d
Out[14]: False