8000 Add support for `doc` attribute on dataclass fields by Viicos · Pull Request #12077 · pydantic/pydantic · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@Viicos
Copy link
Member
@Viicos Viicos commented Jul 21, 2025

Change Summary

Introduced in python/cpython#114051.

Related issue number

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

@github-actions github-actions bot added the relnotes-fix Used for bugfixes. label Jul 21, 2025
@Viicos Viicos added relnotes-feature needs-blogpost-entry This PR needs to be documented in the release notes blog post and removed relnotes-fix Used for bugfixes. labels Jul 21, 2025
@Viicos Viicos requested a review from davidhewitt July 21, 2025 15:06
@cloudflare-workers-and-pages
Copy link
cloudflare-workers-and-pages bot commented Jul 21, 2025

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0bf9bb0
Status: ✅  Deploy successful!
Preview URL: https://aa0b6ac4.pydantic-docs.pages.dev
Branch Preview URL: https://dataclass-field-doc.pydantic-docs.pages.dev

View logs

@github-actions
Copy link
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  pydantic
  fields.py
  pydantic/_internal
  _dataclasses.py
Project Total  

This report was generated by python-coverage-comment-action

@codspeed-hq
Copy link
codspeed-hq bot commented Jul 21, 2025

CodSpeed Performance Report

Merging #12077 will not alter performance

Comparing dataclass-field-doc (0bf9bb0) with main (702aaa6)

Summary

✅ 46 untouched benchmarks

assert child.y == 1


def test_kw_only_inheritance_on_field() -> None:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would previously fail with an unhandled exception with 3.9. Although it doesn't make sense to use it in 3.9 (and we could add a warning -- not worth the effort as we'll drop support for it soon), still better to not hard error.

Copy link
Contributor
@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with tiny test suggestion

@Viicos Viicos enabled auto-merge (squash) July 23, 2025 10:43
@Viicos Viicos merged commit b0175de into main Jul 23, 2025
60 of 61 checks passed
@Viicos Viicos deleted the dataclass-field-doc branch July 23, 2025 10:49
@Viicos Viicos removed the needs-blogpost-entry This PR needs to be documented in the release notes blog post label Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0