New GitHub issue #118541 from nineteendo:<br>

<hr>

<pre>
# Bug report

### Bug description:

```python
import time

print('hello', flush=False)
time.sleep(10)
print('world')
```

Before sleep:

![before](https://github.com/python/cpython/assets/65588599/ec8049ae-b59d-4ab4-b0ac-6c28fd7fb46e)

After sleep:

![after](https://github.com/python/cpython/assets/65588599/ece30a25-f2a6-44f4-8593-1f30b47292cd)

This causes flickering when displaying text in a CLI, which is how I discovered this.

New signature, backwards compatible (if you didn't use the default argument `flush=False`):

```python
@overload
def print(
    *values: object,
    sep: str | None = " ",
    end: str | None = "\n",
 file: _SupportsWriteAndFlush[str] | None = None,
    flush: Literal[True] | None = None
) -> None: ...

@overload
def print(
    *values: object,
 sep: str | None = " ",
    end: str | None = "\n",
    file: SupportsWrite[str] | None = None,
    flush: Literal[False]
) -> None: ...
```

### CPython versions tested on:

3.12

### Operating systems tested on:

macOS
</pre>

<hr>

<a href="https://github.com/python/cpython/issues/118541">View on GitHub</a>
<p>Labels: type-bug</p>
<p>Assignee: </p>