Re: multiple JSON documents in one file, change proposal

2018-12-01 Thread Akkana Peck
Grant Edwards writes: > This is what "archive" file formats are for. Just use tar, zip, ar, > cpio, or some other file format designed to store multiple "files" of > arbitrary data -- there are plenty of "standard" formats to choose > from and plenty of libraries to deal with them. Then the data

Re: ValueError vs IndexError, unpacking arguments with string.split

2018-12-01 Thread Chris Angelico
On Sun, Dec 2, 2018 at 11:55 AM Morten W. Petersen wrote: > > On Sat, Dec 1, 2018 at 1:11 AM Chris Angelico wrote: >> >> On Sat, Dec 1, 2018 at 10:55 AM Morten W. Petersen wrote: >> > But this raises the question of how to write Python code, >> > short and sweet, that could handle infinite itera

Re: ValueError vs IndexError, unpacking arguments with string.split

2018-12-01 Thread Morten W. Petersen
On Sat, Dec 1, 2018 at 1:11 AM Chris Angelico wrote: > On Sat, Dec 1, 2018 at 10:55 AM Morten W. Petersen > wrote: > > But this raises the question of how to write Python code, > > short and sweet, that could handle infinite iterators in > > such an unpack with multiple variables to assign to. >

Re: multiple JSON documents in one file, change proposal

2018-12-01 Thread Grant Edwards
On 2018-11-30, Marko Rauhamaa wrote: > Paul Rubin : >> Maybe someone can convince me I'm misusing JSON but I often want to >> write out a file containing multiple records, and it's convenient to >> use JSON to represent the record data. >> >> The obvious way to read a JSON doc from a file is with

Re: multiple JSON documents in one file, change proposal

2018-12-01 Thread Ben Bacarisse
Marko Rauhamaa writes: > Chris Angelico : > >> On Sat, Dec 1, 2018 at 10:16 PM Marko Rauhamaa wrote: >>> and the framing format is HTTP. I will need to type something like this: >>> >>>POST / HTTP/1.1^M >>>Host: localhost^M >>>Content-type: application/json^M >>>Content-length: 5

Re: multiple JSON documents in one file, change proposal

2018-12-01 Thread Marko Rauhamaa
Chris Angelico : > On Sat, Dec 1, 2018 at 10:16 PM Marko Rauhamaa wrote: >> and the framing format is HTTP. I will need to type something like this: >> >>POST / HTTP/1.1^M >>Host: localhost^M >>Content-type: application/json^M >>Content-length: 54^M >>^M >>{ >>"msg

Re: multiple JSON documents in one file, change proposal

2018-12-01 Thread Chris Angelico
On Sat, Dec 1, 2018 at 10:16 PM Marko Rauhamaa wrote: > > Chris Angelico : > > On Sat, Dec 1, 2018 at 9:16 PM Marko Rauhamaa wrote: > >> The need for the format to be "typable" (and editable) is essential > >> for ad-hoc manual testing of components. That precludes all framing > >> formats that w

Re: multiple JSON documents in one file, change proposal

2018-12-01 Thread Marko Rauhamaa
Chris Angelico : > On Sat, Dec 1, 2018 at 9:16 PM Marko Rauhamaa wrote: >> The need for the format to be "typable" (and editable) is essential >> for ad-hoc manual testing of components. That precludes all framing >> formats that would necessitate a length prefix. HTTP would be >> horrible to have

Re: multiple JSON documents in one file, change proposal

2018-12-01 Thread Chris Angelico
On Sat, Dec 1, 2018 at 9:16 PM Marko Rauhamaa wrote: > > Paul Rubin : > > > Marko Rauhamaa writes: > >> Having rejected different options ( >> https://en.wikipedia.org/wiki/JSON_streaming>), I settled with > >> terminating each JSON value with an ASCII NUL character, which is > >> illegal in JSON

Re: multiple JSON documents in one file, change proposal

2018-12-01 Thread Marko Rauhamaa
Paul Rubin : > Marko Rauhamaa writes: >> Having rejected different options (> https://en.wikipedia.org/wiki/JSON_streaming>), I settled with >> terminating each JSON value with an ASCII NUL character, which is >> illegal in JSON proper. > > Thanks, that Wikipedia article is helpful. I'd prefer t