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

Better defaults for asdict/astuple #705

Closed
hynek opened this issue Oct 19, 2020 · 1 comment · Fixed by #887
Closed

Better defaults for asdict/astuple #705

hynek opened this issue Oct 19, 2020 · 1 comment · Fixed by #887
Labels
Thinking Needs more braining.
Milestone

Comments

@hynek
Copy link
Member

hynek commented Oct 19, 2020

  • Would it be acceptable to change the default value for retain_collection_types to True? This would reduce the likelihood of this issue to appear unexpectedly. It is not a full fix though.

  • Would it be ok to use tuple as default collection type, when retain_collection_types=False? I would expect this to completely resolve the issue.

Originally posted by @tovrstra in #646 (comment)

@petergaultney
Copy link

I think retain=True makes a lot of sense.

As much as I love tuples (and immutable data in general), it seems risky to (essentially) auto-convert lists to tuples. I imagine there's too much code out there that relies on the Python-wide "default" of mutable container types. It would work fine for my use cases, though.

@hynek hynek mentioned this issue Dec 15, 2021
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Thinking Needs more braining.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants