Skip to content

Conversation

ghost
Copy link

@ghost ghost commented Dec 11, 2024

Description

This pull request addresses the issue where the print_callback needs to be executed before formatting print arguments. Currently, the issue arises as repr() generates output that is not valid code, causing a break in the black formatting of the output.

Changes Made

  • Added a pre-execution step for print_callback to ensure it runs before formatting print arguments. This helps prevent repr() from creating output that breaks the black formatting of the output.

How to Test

  1. Ensure the print_callback is triggered before formatting print arguments.
  2. Verify that the black formatting of the output is not disrupted by invalid code generated by repr().

Related Issue

Link to the original issue

Additional Notes

Any additional information or context about the changes made can be added here.

This is a necessary adjustment to maintain proper formatting integrity and prevent issues caused by invalid code generated during execution.

@samuelcolvin samuelcolvin merged commit d100d16 into pydantic:main Mar 23, 2025
9 checks passed
@samuelcolvin
Copy link
Member

samuelcolvin commented Mar 23, 2025

great, thanks!

Sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant