There are various combinations to try. I think from my brief testing, a tab or a newline after a function value without a comma results in an error. In other words, a function value either has to be immediately followed by a comma, space, or a closing bracket.
Results in:
json.decoder.JSONDecodeError: Invalid control character
Whereas each of the following works and results in:
{'a': 'my_func'}
Note the trailing comma in the example above.
There are various combinations to try. I think from my brief testing, a tab or a newline after a function value without a comma results in an error. In other words, a function value either has to be immediately followed by a comma, space, or a closing bracket.