You are assuming rule always exists in self.__json_object['Rules']. Thats ok, since you make that check before you ever call this function, but if you do it that way, that has to be documented in the docstring for this method. Just something saying that this method assumes it exists, so its up to the caller to check that.