Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Python stdout/stderr buffering behavior #26624

Merged
merged 7 commits into from
Feb 3, 2025

Conversation

jabraham17
Copy link
Member

@jabraham17 jabraham17 commented Jan 30, 2025

Document the behavior of IO with Chapel and Python interspersed, and tell users how to deal with it.

  • start_test test/library/packages/Python
  • start_test test/library/packages/Python with GASNet

[Reviewed by @DanilaFe]

@jabraham17 jabraham17 changed the title Document python stdout/stderr buffering behavior Document Python stdout/stderr buffering behavior Jan 30, 2025
@jabraham17 jabraham17 marked this pull request as ready for review January 30, 2025 00:12
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
@jabraham17 jabraham17 requested a review from DanilaFe January 30, 2025 00:41
@@ -90,7 +91,7 @@ proc test_three_args_with_default_and_kwargs(mod: borrowed Module) {
func(NoneType, 8, kwargs=["b" => 10]);
func(NoneType, 8, kwargs=["c" => 11, "abc" => 12]);
}
proc test_varargs_and_kwargs(mod: borrowed Module) {
proc test_varargs_and_kwargs(mod: borrowed Module, flush: borrowed Value) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can't you make flush a global variable instead of threading it through?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but that would require making interp a global variable as well

Copy link
Contributor

Choose a reason for hiding this comment

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

That makes me think of two things, in ascending order of quality:

  1. Can you make interp global :3
  2. What if interp had a flush method, so that you didn't have to use a Value in user code? Given that you'd need to do this for all interspersed IO, I think it might be worth it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I know this is just a test, but I dislike making interp global. However, I do find adding interp.flush() appealing. Value is definitely a user facing type, but having interp.flush() still seems like a useful helper.

Signed-off-by: Jade Abraham <[email protected]>
@jabraham17 jabraham17 merged commit f09f251 into chapel-lang:main Feb 3, 2025
8 checks passed
@jabraham17 jabraham17 deleted the resolve-python-io branch February 3, 2025 22:54
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.

2 participants