This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author remi.lapeyre
Recipients remi.lapeyre, ys19991
Date 2020-07-12.13:28:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1594560530.5.0.303995355049.issue41284@roundup.psfhosted.org>
In-reply-to
Content
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)
History
Date User Action Args
2020-07-12 13:28:50remi.lapeyresetrecipients: + remi.lapeyre, ys19991
2020-07-12 13:28:50remi.lapeyresetmessageid: <1594560530.5.0.303995355049.issue41284@roundup.psfhosted.org>
2020-07-12 13:28:50remi.lapeyrelinkissue41284 messages
2020-07-12 13:28:50remi.lapeyrecreate