def __contains__ ( self , key ) : k = self . _real_key ( key ) return k in self . _data
python check if key in dect
Invoked when determining whether a specific key is in the dictionary using key in d .
def __contains__(self, key):
        """
        Invoked when determining whether a specific key is in the dictionary
        using `key in d`.

        The key is looked up case-insensitively.
        """
        k = self._real_key(key)
        return k in self._data