pynsee
pynsee copied to clipboard
Improve session management
Overall requests.Session objects do not seem to be managed consistently (or sometimes even just properly) throughout the code.
Though I don't think it is likely to lead to severe issues, it could be made cleaner and generally more straightforward to understand if with statements were used systematically, together with actual benchmarks to see whether this improves performance.
I agree using with everywhere in the package is the best option.
Normally, thanks to this commit 17ea1c7, all remaining open sessions should have been closed.
Once #162 is merged, store the session object in the config dict and use it throughout the code (cf. tgradje's comment)