catmaid / catpy

Python client for the CATMAID API
MIT License
4 stars 3 forks source link

deserialising JSON multiple times (no_verify switch for fetch?) #33

Open clbarnes opened 6 years ago

clbarnes commented 6 years ago

Currently, fetch deserialises the JSON to check for errors, even if the user wants the raw result. This could be a performance issue. Furthermore, the requests.Response object does not cache its .json() result, so when the user doesn't want the raw result, they deserialise the same (possibly large) JSON twice.

Should raw automatically apply no_verify? Is there even a need to have two separate switches?

clbarnes commented 6 years ago

Currently the content is deserialised twice in normal circumstances, three times on error.