dacite
dacite copied to clipboard
Feature/handle generics
This is a draft PR for introducing the handling of typing generics. Feel free to review this PR, but keep in mind it is not yet finished—publishing it just for the sake of code reviews and brainstorming.
Fixes #131 Fixes #157 Fixes #160
TODO
- [ ] Add much more test cases that use
typing.Generic
andtyping.TypeVar
. - [ ] Consider handling other typing shenanigans, like
Annotated
,TypeAlias
,TypeVarTuple
. - [x] Backport
typing.get_origin
andtyping.get_args
for lower Python versions. - [x] Refactor and clean up the code, it's super ugly at the moment.
- [ ] Consider using
typing. TypeGuard
for typehinting theis_instance
and its related functions.
@konradhalas After consideration I think it could already be merged as is feature-wise. Maybe we might want to write a few more tests, but that would be it. What do you think?