You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromenumimportEnumfrompydanticimportBaseModelclassAlignment(Enum):
LEFT="PKTextAlignmentLeft"classDateStyle(Enum):
SHORT="PKDateStyleShort"classField(BaseModel):
i:int=0textAlignment: Alignment=Alignment.LEFT# when I comment out this line, it worksclassDateField(Field):
""""""# when I comment out one of these lines, it worksdateStyle: DateStyle=DateStyle.SHORTtimeStyle: DateStyle=DateStyle.SHORTclassPass(BaseModel):
# when I comment out one of these lines, it worksrelevantDate: DateField|str|None=NoneexpirationDate: DateField|None=NonePass.model_rebuild(force=True)
Python, Pydantic & OS Version
OSX:
pydantic version: 2.4.0
pydantic-core version: 2.10.0
pydantic-core build: profile=release pgo=false
install path: /Users/phil/tmp/schas1/venv/lib/python3.11/site-packages/pydantic
python version: 3.11.3 (main, Apr 7 2023, 19:25:52) [Clang 14.0.0 (clang-1400.0.29.202)]
platform: macOS-13.2.1-x86_64-i386-64bit
related packages: typing_extensions-4.8.0
LINUX:
pydantic version: 2.4.0
pydantic-core version: 2.10.0
pydantic-core build: profile=release pgo=true
install path: /home/phil/dev/projects/edutap/apple-pass-creator-service/venv/lib/python3.10/site-packages/pydantic
python version: 3.10.7 (main, May 29 2023, 13:51:48) [GCC 12.2.0]
platform: Linux-5.19.0-46-generic-x86_64-with-glibc2.36
related packages: typing_extensions-4.8.0 fastapi-0.103.1
As stated above, everything works fine with pydantic 2.3.0
The text was updated successfully, but these errors were encountered:
Initial Checks
Description
pydantic version 2.4.0 fails at rebuilding a model.
the same code works with pydantic 2.3.0
steps with which I can reproduce the error on OSX and Linux:
where killpydantic.py contains the code below
Example Code
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: