# What changed in polyfactory

> 15 changes in polyfactory 3 from its official release notes, upgrade guides and advisories: 1 breaking, 3 new APIs and options. Each one cited. Sources checked 2026-10-24. HTML: https://unstale.sh/pypi/polyfactory/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## polyfactory 3

### Breaking changes

- Default values are no longer fetched from TypedDict models. (3.4.0) — [release notes](https://github.com/litestar-org/polyfactory/releases/tag/v3.4.0)

### New APIs and options

- __use_examples__ is now supported in all factories. (3.4.0) — [release notes](https://github.com/litestar-org/polyfactory/releases/tag/v3.4.0)
- Adds __persistence__method__ to SQLAlchemyFactory. (3.3.0) — [release notes](https://github.com/litestar-org/polyfactory/releases/tag/v3.3.0)
- Adds support for SQLAlchemy computed fields. (3.3.0) — [release notes](https://github.com/litestar-org/polyfactory/releases/tag/v3.3.0)

### Behavior and default changes

- The session lifecycle is managed when a session is created implicitly. (3.4.0) — [release notes](https://github.com/litestar-org/polyfactory/releases/tag/v3.4.0)

### Fixes and other changes

- Pydantic factories now respect __by_name__ when fields define Field(alias=...). (3.5.0) — [release notes](https://github.com/litestar-org/polyfactory/releases/tag/v3.5.0)
- Adds support for Python 3.15. (3.5.0) — [release notes](https://github.com/litestar-org/polyfactory/releases/tag/v3.5.0)
- The by_name keyword argument is guarded for pydantic versions earlier than 2.11. (3.4.0) — [release notes](https://github.com/litestar-org/polyfactory/releases/tag/v3.4.0)
- Timezone handling for end_date is fixed. (3.4.0) — [release notes](https://github.com/litestar-org/polyfactory/releases/tag/v3.4.0)
- Date constraint handling now handles bool tz constraints from msgspec.Meta. (3.4.0) — [release notes](https://github.com/litestar-org/polyfactory/releases/tag/v3.4.0)
- Resolution order now favours provider types. (3.4.0) — [release notes](https://github.com/litestar-org/polyfactory/releases/tag/v3.4.0)
- Pydantic examples in nested type annotations are now supported. (3.4.0) — [release notes](https://github.com/litestar-org/polyfactory/releases/tag/v3.4.0)
- More supporting BaseFactories are found for unsupported types. (3.4.0) — [release notes](https://github.com/litestar-org/polyfactory/releases/tag/v3.4.0)
- TypedDictFactory now supports ReadOnly fields. (3.4.0) — [release notes](https://github.com/litestar-org/polyfactory/releases/tag/v3.4.0)
- Leaves the async session opened after persisting data. (3.3.0) — [release notes](https://github.com/litestar-org/polyfactory/releases/tag/v3.3.0)
