On 3/27/17 10:40 AM, Ram Rachum wrote:
Another idea: Maybe make json.load and json.dump support Path objects?

json.dump requires open file objects, not strings or Paths representing filenames.

But does this not already do what you want:

Path('foo.json').write_text(json.dumps(obj))
?

Eric.
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to