questionlp’s avatarquestionlp’s Twitter Archive—№ 38,580

  1. …in reply to @mathsppblog
    @mathsppblog The only possible gotcha is if the value of sale_dict["discounted"] is None. It would return "None" rather than 1 because the key exists. Gets dicey if you convert JSON into a dictionary and one of the properties is null/None.
    1. …in reply to @questionlp
      @mathsppblog I got bitten by that a couple of times when pulling in JSON from either Salesforce or Zendesk API where they would return a property as null in JSON if a certain condition wasn't met.