Skip to content

asdict(): Optionally retain collection types #69

@vortec

Description

@vortec

When calling attr.asdict(), it converts attributes of type tuple, set to type list and subclasses of dict to dict. This is being done for JSON compatibility, however, there are use cases where it's required to preserve the original type.

Therefore I request an optional argument called retain_collection_types, which is set to False by default (to not break the existing API). If enabled, the function should not convert any collection type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions