bday-boy / aiokemon

An asynchronous Python wrapper for making PokéAPI requests.
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Remove redundant .json() call in _get_json #15

Closed bday-boy closed 2 years ago

bday-boy commented 2 years ago

The current code awaits a response.json() call and, if that item doesn't exist in the cache, the resulting dict is dumped back into a JSON string, compressed, and put in the cache. I would like to make it so that the _get_json function just gets the response text, and the _get function itself is the one that handles the JSON decoding (when not found in the cache).