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
merged 5 commits into from Jun 21, 2017

Conversation

Projects
None yet
2 participants
@abonie
Contributor

abonie 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

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

1 check passed

ci/circleci Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment