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 array_like (de)serialization for dataclasses #234

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mishamsk
Copy link
Contributor

@mishamsk mishamsk commented Jul 4, 2024

Hi!

Wanted to float an idea of adding "array_like" serialization format for data classes. Essentially the same as this msgspec feature.

As of time of writing this is just a POC, see this single new test for a sample.

Such an option will be a big size reduction/performance boost, but the interaction with other options will be pretty tricky. At least the discrimination and defaults handling will have to be carefully handled. Some configuration combinations will have to be forbidden (e.g. skipping defaults with array_like enabled).

Wanted to get some feedback early before doing the entire thing, hence opening PR so early.

@pep8speaks
Copy link

Hello @mishamsk! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 1385:80: E501 line too long (80 > 79 characters)
Line 1391:80: E501 line too long (80 > 79 characters)

Line 389:1: E302 expected 2 blank lines, found 1

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.

2 participants