On Mon, Mar 27, 2017 at 7:59 AM, Paul Moore <[email protected]> wrote:

> On 27 March 2017 at 15:40, Ram Rachum <[email protected]> wrote:
> > Another idea: Maybe make json.load and json.dump support Path objects?
>
> If they currently supported filenames, I'd say that's a reasonable
> extension. Given that they don't, it still seems like more effort than
> it's worth to save a few characters
>

Sure, but they probably should -- it's a REALLY common (most common)
use-case to read and write JSON from a file. And many APIs support
"filename or open file-like object".

I'd love to see that added, and, or course, support for Path objects as
well.

-CHB




-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[email protected]
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to