Add new strategy register_extra_types#645
Add new strategy register_extra_types#645makukha wants to merge 17 commits intopython-attrs:mainfrom
Conversation
… circular import from cattrs.fns (type-annotated function will be added there)
|
@Tinche sorry for the long delay, had to complete some work. Could you please take a look at this draft? It must have flaws, so please feel free to suggest or make any changes. I added a couple of tests, but probably missed some important test cases. It is a pleasure to work on cattrs codebase :) |
|
My baby's sleep regression is kicking my ass so I'm also going to ask for some patience 😇 From what I understand, the api is supposed to be Doesn't require an import, gets auto complete, a little more discoverable? |
|
Thank you for finding time for this feature! I wish health and strength to you and your family. For the API design, I was keeping in mind future extensibility with user plugins, so that I use If you are still confident that kwarg-based approach is better, I have no objections to follow this direction until |
Contribution to #641.
Converters supported:
BaseConverter,Converter, all preconfigured convertersExtra types added:
complexuuid.UUIDzoneinfo.ZoneInfoMore extra types to be added in this pull request:
array.arraydatetime:date,datetime(not supported by rawBaseConverterandConverter)datetime:time,timedeltadecimal.Decimalfraction.Fractionipaddress: ...numbers:Complex,Real,Rational,Integralnumpy: ...pathlib.Pathre.Pattern