Skip to content

Conversation

Viicos
Copy link
Member

@Viicos Viicos commented Sep 25, 2024

Change Summary

Fixes #10463. I don't know if this handle all the cases (I first looked into the pprint module, which takes a different approach using a context dict. It may be more robust, but at least what we implement here handles trivial use cases such as the one from the issue without too many changes in the implementation).

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 Sep 25, 2024
Copy link

cloudflare-workers-and-pages bot commented Sep 25, 2024

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: ea50267
Status: ✅  Deploy successful!
Preview URL: https://bc923712.pydantic-docs.pages.dev
Branch Preview URL: https://10463.pydantic-docs.pages.dev

View logs

Copy link

codspeed-hq bot commented Sep 25, 2024

CodSpeed Performance Report

Merging #10480 will not alter performance

Comparing 10463 (ea50267) with main (43ed0d3)

Summary

✅ 38 untouched benchmarks

Copy link
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  pydantic
  main.py
  pydantic/_internal
  _repr.py
Project Total  

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

@Viicos
Copy link
Member Author

Viicos commented Sep 25, 2024

https://docs.python.org/3/library/reprlib.html#reprlib.recursive_repr might also be interesting to look at

Copy link
Contributor

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

Nice. Definite improvement over our current behavior.

@sydney-runkle sydney-runkle merged commit b195eec into main Sep 25, 2024
61 checks passed
@sydney-runkle sydney-runkle deleted the 10463 branch September 25, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes-fix Used for bugfixes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash with recursive repr/str/print
2 participants