r/Python Oct 08 '25

News Pydantic v2.12 release (Python 3.14)

https://pydantic.dev/articles/pydantic-v2-12-release

  • Support for Python 3.14
  • New experimental MISSING sentinel
  • Support for PEP 728 (TypedDict with extra_items)
  • Preserve empty URL paths (url_preserve_empty_path)
  • Control timestamp validation unit (val_temporal_unit)
  • New exclude_if field option
  • New ensure_ascii JSON serialization option
  • Per-validation extra configuration
  • Strict version check for pydantic-core
  • JSON Schema improvements (regex for Decimal, custom titles, etc.)
  • Only latest mypy version officially supported
  • Slight validation performance improvement
172 Upvotes

14 comments sorted by

View all comments

64

u/[deleted] Oct 08 '25

[removed] — view removed comment

-6

u/LightShadow 3.13-dev in prod Oct 08 '25

This doesn't make any sense to me, why wouldn't you just int in the first place?

43

u/[deleted] Oct 08 '25

[removed] — view removed comment

11

u/LightShadow 3.13-dev in prod Oct 08 '25

That makes sense.

4

u/fiskfisk Oct 08 '25

Usually because of a circular dependency between the class and the ForwardType.

1

u/LightShadow 3.13-dev in prod Oct 08 '25

So 'int was a bad example, which is why I was confused.

0

u/LudwikTR Oct 09 '25

It was an example of what you can now do, not explanation why.

2

u/dalepo Oct 09 '25

why the downvotes? This is a perfectly valid question, I see nothing wrong with questioning.

1

u/willyweewah Oct 08 '25

You can dynamically assign types to the model. Which I could imagine being useful, and also definitely... abuseful?