xsdata icon indicating copy to clipboard operation
xsdata copied to clipboard

PEP 604: Write union types as X | Y

Open aszakacs opened this issue 6 months ago • 1 comments

Ever since Python 3.10, where PEP 604 was implemented, the recommended way of writing union type hints is no longer Union[X, Y], but instead X | Y. The same thing goes for str | None replacing Optional[str]. It would be great to see this update in the dataclasses generated by xsdata.

aszakacs avatar Jun 19 '25 14:06 aszakacs

It's coming, waiting for 3.9 eol.

tefra avatar Jul 06 '25 07:07 tefra