Function
wrapper
(
*args: object,
sep: str = " ",
end: str = "\n",
file: TextIO | None = None,
flush: bool = False,
)
Source from the content-addressed store, hash-verified
| 263 | def print_wrapper(func: Callable[..., None]) -> Callable[..., None]: |
| 264 | @functools.wraps(func) |
| 265 | def wrapper( |
| 266 | *args: object, |
| 267 | sep: str = " ", |
| 268 | end: str = "\n", |
| 269 | file: TextIO | None = None, |
| 270 | flush: bool = False, |
| 271 | ) -> None: |
| 272 | target = file if file is not None else sys.stdout |
| 273 | if target is not None and target in ( |
| 274 | sys.stdout, |
| 275 | sys.stderr, |
| 276 | ): |
| 277 | target.write(sep.join(map(str, args)) + end) |
| 278 | if flush: |
| 279 | target.flush() |
| 280 | else: |
| 281 | # User specified a different file, use original print behavior |
| 282 | func(*args, sep=sep, end=end, file=file, flush=flush) |
| 283 | |
| 284 | return wrapper |
| 285 | |
Callers
nothing calls this directly
Tested by
no test coverage detected