Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding json #577

merged 5 commits into from Jun 21, 2017


None yet
2 participants
Copy link

commented Jun 20, 2017

Native implementation of parts of json module: json.dump, json.dumps and json.JSONEncoder.

For the time being iterencode method of JSONEncoder returns a length 1 list instead of a generator.
JSONEncoder should be a class but instead is a factory function returning JSONEncoder objects. That is because there is currently no way to pass keyword arguments to object constructors implemented in JavaScript.

abonie added some commits Jun 6, 2017

Working on JSONEncoder's encode method
basic implementation of JSONEncoder - does not accept arguments on init
basic implementation of encode - needs to be properly tested, there is
some sort of bug while encoding booleans, no circular structure checking
or error handing in general
some simple tests - would be great to reduce boilerplate somehow
Accept arguments in JSONEncoder constructor
In order to allow JSONEncoder to accept keyword arguments there is now a
dummy JSONEncoder function (not an actual ctor) that creates instances
of JSONEncoder (like a factory). Most of arguments functionality is
still lacking.
Implement indent, separators, allow_nan, skipkeys
Most of the keyword arguments to JSONEncoder has been implemented. Still
missing sort_keys, check_circular and ensure_ascii.
Refactor and add missing features
Refactor tests and module structure

Implement ensure_ascii, check_circular, dump, dumps and iterencode
Copy link

left a comment


@freakboy3742 freakboy3742 merged commit bbeefbf into beeware:master Jun 21, 2017

1 check passed

ci/circleci Your tests passed on CircleCI!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.