Describe the bug
A clear and concise description of what the bug is.
@pydantic.dataclasses.dataclass
's __init__
type hint stop working
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
should work as stdlib dataclasses
Screenshots
If applicable, add screenshots to help explain your problem.
Also, gif movies are recommended.
Environments (please complete the following information):
Additional context
Add any other context about the problem here.
import enum
import pydantic.dataclasses
@enum.verify(enum.UNIQUE)
class SeedingStrategy(enum.Enum):
Rolling = "rolling"
Reserve = "reserve"
@enum.verify(enum.UNIQUE)
class Website(enum.StrEnum):
a = "a"
b = "b"
def category(self):
if self in [e for e in Website]:
return self
raise Exception("missing category config")
@pydantic.dataclasses.dataclass
class Config:
site: Website
cluster: str
strategy: SeedingStrategy
qb_category: str
qb_max_queue: int = 5
qb_tags: list = pydantic.Field([])
sample_rate: float = pydantic.Field(default=1, gt=0, le=1)
if __name__ == "__main__":
Config(sa|) # <- cursor here
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too