Validate native py::print delegation with comprehensive tests - #6122
Validate native py::print delegation with comprehensive tests#6122rwgk wants to merge 3 commits into
Conversation
Result of the comprehensive CI validation experimentPR #6122 intentionally carried much broader test coverage than is planned for the final change in #6121. Its purpose was to combine the native- The final result is 73 passing checks, two skipped CI checks, and three failing PyPy 3.11 jobs. No failure points to a problem in the production implementation. The three failures—on Ubuntu, macOS, and Windows—all come from the same assertion in This is useful evidence rather than a delegation failure: it identifies exactly the kind of runtime-owned behavior that pybind11 should not duplicate or freeze in its tests. All other print coverage passed in the same PyPy jobs, including the direct test that replaces the current built-in Across the rest of the matrix, the comprehensive tests exercised argument and keyword handling, The experiment therefore supports the simpler final shape for #6121:
In other words, #6122 provided the broad validation scaffolding; #6121 can now keep the implementation and tests deliberately small without relying on untested assumptions. |
|
This experimental PR has served its purpose. Closing. |
Description
This is a companion experiment to #6121 and an alternative to #6120. It uses the same production change as #6121: delegate
py::printto Python's currentprintcallable instead of maintaining a separate implementation.This branch temporarily adds the comprehensive behavior tests developed around #6120, adapted where necessary to compare runtime-owned behavior with the active runtime's native
print. The purpose of this PR is to run the full CI matrix and confirm our expectations across supported interpreters and platforms, including argument and keyword handling, stream and flush behavior, exception propagation, and interpreter/subinterpreter shutdown.If that validation succeeds, the plan is not to retain this comprehensive test suite in the final change. We will trim the tests in #6121 back to the aspects owned by pybind11: proving that
py::printresolves the currentprintcallable, forwards its arguments and keywords unchanged, and propagates failures. Details of nativeprintbehavior should remain the Python runtime's responsibility rather than being frozen in pybind11's tests.This follows up on the original delegation suggestion in #6120.
Local validation
Documentation changes are deliberately left out of this experimental validation PR.