Format obj in the JSON style for a value
(obj)
| 26 | |
| 27 | |
| 28 | def json_value(obj): |
| 29 | """Format obj in the JSON style for a value""" |
| 30 | if type(obj) is bool: |
| 31 | if obj: |
| 32 | return '*true*' |
| 33 | return '*false*' |
| 34 | if type(obj) is str: |
| 35 | return '"' + esc_underscores(obj) + '"' |
| 36 | if obj is None: |
| 37 | return '*null*' |
| 38 | assert False |
| 39 | |
| 40 | |
| 41 | def outputs(lines, separator=''): |
no test coverage detected