-
-
Notifications
You must be signed in to change notification settings - Fork 69
Closed
Description
The default generator has to remain compatible with all python versions, but someone could use https://github.com/asottile/pyupgrade to upgrade to 3.10 syntax.
Foo | Bar instead of typing.Union[Foo, Bar]
FooBar | None instead of typing.Optional[FooBar]
dict[str, FooBar] instead of typing.Dict[str, FooBar]
list[FooBar] instead of typing.List[FooBar]
tuple[FooBar, ...] instead of typing.Tuple[FooBar, ...]
xsdata should be able to resolve the typing annotations but there are a couple of issues
- The new UnionType is not supported at all by xsdata
- The subscriptable types don't evaluate forward references correctly, the issue was fixed in 3.11 but it wasn't backported to 3.10
The first issue is easy to correct but the second I am not so sure.
Metadata
Metadata
Assignees
Labels
No labels