I'm not sure I would call it "detailed", but yeah I put it together in less than two minutes.
It has to do with the way I write code to begin with. Anytime I write code with a structure where I'm looping through one thing to create another, I ask myself if it can be done with a comprehension. You use them enough and you start to see things in a different way.
For instance take a look at the nested loop in my first script (I'll remove the style for simplisity)
row_object = {}
row_value = {}
for name,colValue in zip(ds.getColumnNames(),row):
row_value[name] = colValue
row_object['value'] = row_value
First anytime I'm writing a loop and the first thing I do is declare an empty sequence or map, that is almost a dead giveaway that a comprehension may be possible. Second, I not to use variables just to only use them on the next line. There is no reason for row_value to exists as a variable here. This code could be rewritten as this
row_object = {}
for name, colValue in zip(ds.getColumnNames(),row):
row_object['value'][name] = colValue
Once you've done that, it's a simple leap the comprehension. So then you're left with:
newJSON[]
for count,row in enumerate(ds):
row_object = { 'value':{name:colValue for name,colValue in zip(ds.getColumnNames(),row}}
newJSON.append(row_object)
Using the same logic as before, it's easy to make the leap to a comprehension.
Don't forget. Ignition uses Jython, not Python, and Jython only uses 2.7. Ultimately, Inductive determines what scripting language and version are supported. There will be plenty of notice from IA if that changes, I wouldn't be concerned with it very much at all. It barely crosses my mind unless I'm trying to figure out how to make something work and keep getting Python 3 examples.