dacite icon indicating copy to clipboard operation
dacite copied to clipboard

Feature/handle generics

Open mciszczon opened this issue 1 year ago • 1 comments

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 and typing.TypeVar.
  • [ ] Consider handling other typing shenanigans, like Annotated, TypeAlias, TypeVarTuple.
  • [x] Backport typing.get_origin and typing.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 the is_instance and its related functions.

mciszczon avatar Jan 09 '23 13:01 mciszczon

@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?

mciszczon avatar May 15 '23 11:05 mciszczon