dotmap icon indicating copy to clipboard operation
dotmap copied to clipboard

Best way to pprint dotmap dict to a json file ?

Open SvenMeyer opened this issue 5 years ago • 2 comments

What's the best way to pprint dotmap dict to a json file ?

SvenMeyer avatar Oct 20 '19 05:10 SvenMeyer

i ended up just copy-pasting the code from pprint.

Is it possible that within pprint , the else case should read print(self.toDict())and not pprint(self.toDict()) ?

SvenMeyer avatar Oct 20 '19 07:10 SvenMeyer

Why do you think that? It's been years since I wrote that code but I wouldn't recommend changing it without having a good reason.

If you would like to modify the pprint function to have a file parameter as in Python's print statement, feel free to fork and create a pull request with the modification. I'd be happy to review.

drgrib avatar Oct 20 '19 13:10 drgrib