Closed r4victor closed 2 weeks ago
Yup. Makes sense. I've already solved this problem in some of my other libraries such as Cadwyn. Will take care of it soon.
Sorry for being away for so long. I came back to fix it.
Update: Seems like it's alright in the latest version. I guess we just forgot to close it. I'll close it but feel free to reopen it if the issue is not fixed for you.
python-duality
recursively resolves annotations likeA | B
,list[A]
,tuple[A]
, etc, but fails to resolve any of the types fromtyping
such asUnion
,List
,NamedTuple
, etc.Here's an example with
list
vsList
.And the traceback:
This is because
GenericAlias
annotations are all handled in_resolve_annotation()
: https://github.com/zmievsa/pydantic-duality/blob/4027d106cb5604e234fecfc43a5a60a5f15137aa/pydantic_duality/__init__.py#L33but none of the
typing
types are.There are a lot of types to be handled. This can certainly be done on a one-by-one basis. I'm not sure if there is a generic way to do that.