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

Support passing the dict class to asdict #40

Closed
Tinche opened this Issue May 4, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@Tinche
Member

Tinche commented May 4, 2016

A feature idea: attr.asdict currently turns classed into ordinary Python dicts. It'd be useful if a dict factory could be passed in (defauting to just dict). The main use case would be to pass in OrderedDict.

I have a situation at work that this would be useful for, but we're approaching the problem from a different angle so we probably won't need it. Just thought it might be a useful feature and simple to implement. I could put together a pull request.

@hynek

This comment has been minimized.

Member

hynek commented May 6, 2016

I guess it might be worth it if it doesn’t add too much complexity. Retaining the order of the attributes sounds like a good thing.

@Tinche

This comment has been minimized.

Member

Tinche commented May 17, 2016

Fixed by #42.

@Tinche Tinche closed this May 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment