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

Add asJsonAdaptor to PyProxy of Sequence or Map #4666

Merged
merged 3 commits into from Apr 12, 2024

Conversation

hoodmane
Copy link
Member

@hoodmane hoodmane commented Apr 4, 2024

Designed to make dictionaries + lists behave like JavaScript JSON so that JSON.stringify, Response.json, etc work as expected and direct access like a[0].b.c[1].d works. I think this is how as_object_map() should have behaved all along. As a followup, I'd also like to add a symmetric as_json_adaptor() to JsProxy.

  • Add a CHANGELOG entry
  • Add / update tests
  • Add new / update outdated documentation

Designed to make dictionaries + lists behave like JavaScript JSON so that
`JSON.stringify`, `Response.json`, etc work as expected and direct access like
`a[0].b.c[1].d` works. I think this is how `as_object_map()` should have behaved
all along. As a followup, I'd also like to add a symmetric `as_json_adaptor()`
to JsProxy.
Copy link
Member

@ryanking13 ryanking13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. Thanks!

@hoodmane hoodmane merged commit 5679e7c into pyodide:main Apr 12, 2024
23 of 28 checks passed
@hoodmane hoodmane deleted the json-adaptor branch April 12, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants