[issue41284] High Level API for json file parsing

Rémi Lapeyre report at bugs.python.org
Sun Jul 12 09:28:50 EDT 2020


Rémi Lapeyre <remi.lapeyre at henki.fr> added the comment:

Hi, using a file object is very common as it makes it possible to use something that is not a file, like an HTTP request or something already in memory. It makes the module serializing / de-serializing the data completely agnostic with regard to the actual physical storage which has some advantages, for example it will not raise FileNotFound.

If you want a oneliner to load data you already can use:



    with open(filepath) as f: data = json.load(f)

----------
nosy: +remi.lapeyre

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41284>
_______________________________________


More information about the Python-bugs-list mailing list