Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request] Allow NamedTuple to be used with Homogeneous collections #172

Closed
skewty opened this issue Feb 10, 2024 · 1 comment
Closed
Labels
enhancement New feature or request v2 Version 2 related

Comments

@skewty
Copy link

skewty commented Feb 10, 2024

It would be really nice to use NamedTuple with Homogeneous collections as in

class SenderAddress(RootXmlModel[str], tag="address"):
    pass

class SenderName(RootXmlModel[str], tag="name"):
    pass

class Sender(NamedTuple):
    address: SenderAddress | None
    name: SenderName | None

class SenderData(RootXmlModel, tag="senderdata"):
    root: list[Sender]

but I get: pydantic_xml.errors.ModelError: type call is not supported.

@dapper91 dapper91 added enhancement New feature or request v2 Version 2 related labels Feb 11, 2024
@dapper91
Copy link
Owner

Implemented in version 2.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v2 Version 2 related
Projects
None yet
Development

No branches or pull requests

2 participants