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.
When calling
attr.asdict(), it converts attributes of typetuple,setto typelistand subclasses ofdicttodict. 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 toFalseby default (to not break the existing API). If enabled, the function should not convert any collection type.