jsonlite icon indicating copy to clipboard operation
jsonlite copied to clipboard

stream_out does not return NULL as indicated in document

Open everdark opened this issue 8 years ago • 0 comments

Hi,

Probably starting from 0.9.20 (I didn't encounter this in 0.9.19) and up to 1.0, I've noticed that stream_out can no longer return NULL, instead, a list is returned.

For example:

library(jsonlite)
r <- stream_out(cars, verbose=FALSE)
stopifnot(is.list(r))

Sometimes it may return something like:

List of 2
 $ : logi NA
 $ : logi NA

but i don't have example to easily reproduce this. Is this a changed and expected behaviour?

One ramification I can think of is that if the output is to stdout and the returned value is not explicitly captured to a variable, this may cause unwanted result piping out. (This won't be an issue if the function always returns NULL.)

everdark avatar Aug 05 '16 03:08 everdark