Skip to content

Drop 3.9 support and make dataclasses and functions with many arguments keywords-only #2720

@DouweM

Description

@DouweM

Description

Prompted by this TODO:

# TODO: Make this class kw-only so we can reorder the kwargs

But in discussion with @dmontagu we decided we really want this on every dataclass, and all functions with many args. This will allow us to re-order the dataclass fields at will, and makes the code at the call site easier to understand.

@dataclass(kw_only=True) requires Python 3.10, so we've decided to drop support for 3.9 in Pydantic AI v1. That will also allow us to get rid of a bunch of other workarounds.

References

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions