[Python-ideas] Add pathlib.Path.write_json and pathlib.Path.read_json

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Mar 27 19:35:20 EDT 2017


Paul Moore wrote:
> Is this a well-defined idea? ... There's nothing describing how
> multiple values would be stored in the same file/transmitted in the
> same stream.

I think this is something that's outside the scope of the spec.

But since the grammar makes it clear when you've reached the end
of a value, it seems entirely reasonable for a parser to just
stop reading from the stream at that point, and leave whatever
remains for the application to deal with as it sees fit. The
application can then choose to immediately read another value
from the same stream if it wants.

-- 
Greg


More information about the Python-ideas mailing list