mal icon indicating copy to clipboard operation
mal copied to clipboard

pprint properly prints hash-maps

Open jig opened this issue 4 years ago • 1 comments

Current implementation of pprint is not compatible with implementations using languages that do not guarantee that keys on a hash-map keep ordering (e.g. Go language).

This PR corrects this.

jig avatar Sep 10 '21 15:09 jig

With previous code, the effect was that some keys appear duplicated and others do not appear at all when printing a hash-map with pprint.

This fix extracts the keys list only once, so hash-map keys order indetermination is not an issue.

Validated with Go language.

jig avatar Sep 10 '21 15:09 jig