-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
pydantic/pydantic-core
#1272Labels
Milestone
Description
Initial Checks
- I confirm that I'm using Pydantic V2
Description
Parsing integers starting with unary plus (such as +1) fails to parse to an int using pydantic v2.7.0 - found it from a test that broke when trying to upgrade dependencies.
Unary minus, such as -1 works as expected.
Seems related to some int parsing changes mentioned in #9227
Example Code
from pydantic import BaseModel
class Message(BaseModel):
recipient: int
Message(recipient="+1")Python, Pydantic & OS Version
pydantic version: 2.7.0
pydantic-core version: 2.18.1
pydantic-core build: profile=release pgo=true
install path: /home/..../.venv/lib/python3.11/site-packages/pydantic
python version: 3.11.8 (main, Feb 12 2024, 14:50:05) [GCC 13.2.1 20230801]
platform: Linux-6.8.5-arch1-1-x86_64-with-glibc2.39
related packages: typing_extensions-4.11.0 fastapi-0.110.1 mypy-1.9.0
commit: unknown