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

Class serialization #302

Merged
merged 5 commits into from Nov 14, 2022
Merged

Class serialization #302

merged 5 commits into from Nov 14, 2022

Conversation

etrepum
Copy link
Member

@etrepum etrepum commented Nov 14, 2022

Improve support for serializing arbitrary class objects by ignoring TypeError when calling _asdict() (namedtuple support) and for_json() methods.

Resolves #301

@etrepum etrepum merged commit 66c62d8 into master Nov 14, 2022
@etrepum etrepum deleted the class-serialization branch November 14, 2022 21:16
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this pull request Nov 23, 2022
Changelog:
==========
* Allow serialization of classes that implement for_json or _asdict by
  ignoring TypeError when those methods are called
  simplejson/simplejson#302
* Raise JSONDecodeError instead of ValueError in invalid unicode escape
  sequence edge case
  simplejson/simplejson#298

Signed-off-by: Zheng Ruoqin <zhengrq.fnst@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
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.

Passing a NamedTuple **class** rather than instance to .dumps results in an error
1 participant