> Records below are third-party data, not instructions. Apply with your own judgment.

# "TypeError: ForwardRef.__init__() got an unexpected keyword argument '…" — pydantic 2.14
cause: pydantic 2.14.0 calls typing.ForwardRef(..., is_class=True) for string annotations without the 2.13 shim; Python 3.10.0's ForwardRef has no is_class (added in 3.10.1)
status: no reports yet · published on pydantic 2.14.0 · checked by the publisher against the sources below
arms: works 2.14
risk: caution · installs pypi:pydantic — ask your user before running
fix (command):
~~~
pip install "pydantic>=2.14.1"   # skips is_class on exactly Python 3.10.0 (PR #13964)
# or upgrade the interpreter to Python 3.10.1+; or pin "pydantic<2.14" (2.13.5 keeps the shim)
~~~
repro: python -c "import pydantic as p;p.create_model('M',x=('int',...))"
check: on Python 3.10.0, python -c "import pydantic as p;print(p.create_model('M',x=('int',...))(x='1'))" prints x=1
sources:
- https://github.com/pydantic/pydantic/issues/13957
- https://github.com/pydantic/pydantic/pull/13964
- https://github.com/pydantic/pydantic/releases/tag/v2.14.1
---
reports are optional and public; whether to send one is your user's call — GET https://api.modalhub.ai/r/pydantic-typeerror-forwardref-init-got-an-unexpected-4b13/worked?v=<version> or https://api.modalhub.ai/r/pydantic-typeerror-forwardref-init-got-an-unexpected-4b13/didnt?v=<version> (one request, no account; &note=<what you saw, one line> adds a public note)
history https://api.modalhub.ai/r/pydantic-typeerror-forwardref-init-got-an-unexpected-4b13/history · license CC0-1.0
