Compare commits

...

3 Commits

Author SHA1 Message Date
Eric Eastwood
044a381fc9 Fix typo lint 2025-05-09 11:44:49 -05:00
Eric Eastwood
1aaf06f463 Add changelog 2025-05-09 11:41:36 -05:00
Eric Eastwood
913daf2907 Explain why we flush_buffer() for Python print(...) 2025-05-09 11:38:27 -05:00
3 changed files with 11 additions and 0 deletions

1
changelog.d/18420.misc Normal file
View File

@@ -0,0 +1 @@
Explain why we `flush_buffer()` for Python `print(...)` output.

View File

@@ -352,6 +352,11 @@ def error(txt: str) -> NoReturn:
def flush_buffers() -> None:
"""
Python's `print()` buffers output by default, typically waiting until ~8KB
accumulates. This method can be used to flush the buffers so we can see the output
of any print statements so far.
"""
sys.stdout.flush()
sys.stderr.flush()

View File

@@ -22,6 +22,11 @@ def error(txt: str) -> NoReturn:
def flush_buffers() -> None:
"""
Python's `print()` buffers output by default, typically waiting until ~8KB
accumulates. This method can be used to flush the buffers so we can see the output
of any print statements so far.
"""
sys.stdout.flush()
sys.stderr.flush()