(I emailed Eric about this directly, but I thought it might be worth adding my feedback here too, I know it might be too late to alter the PEP, but think could still be helpful to document this issue)
Pydantic has supported the "
Alternate Form" of dataclass transforms for a while which is supported by pyright.
As well as helping lots of people (I assume - happy people don't create issues, and I don't use pyright/pylance/vscode), we have had some issues with the "feature", see
here.
In summary: pydantic has a BaseSettings type which users inherit from to manage settings, fields are defined on a class, then can be configured using environment variables and other external sources.
Because of this you can legitimately use "settings = Settings()" even when your Settings class has required fields - because they're filled from env variables.
The problem is that dataclass transforms apply to BaseSettings, and therefore Settings because BaseSettings inherits from BaseModel (which is marked with the decorator), so users get an error from pyright on "settings = Settings()" saying required fields are missing.
It would be great if there was a way to switch off dataclass transforms on some subclasses. The easiest way for users would be another magic decorator which marked the class (and its subclasses) as "not dataclass-like", but I'd be happy with any way to achieve this, e.g. a kwarg to dataclass_transform.
Samuel