Skip to content
New issue

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

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

Already on GitHub? # to your account

New example - execution order broken because of unflushed output buffer #140

Closed
roshnet opened this issue Sep 16, 2019 · 0 comments
Closed
Assignees
Milestone

Comments

@roshnet
Copy link

roshnet commented Sep 16, 2019

On running the following script -

import time

print('hey', end='')
time.sleep(3)

hey prints after the delay, which is surprising at the first sight.

Because of end='', the output buffer remains unflushed, and Python waits for the program to finish, before printing anything to the console.

roshnet added a commit to roshnet/wtfpython that referenced this issue Sep 16, 2019
Add example - Python breaks order because of unflushed output buffer.

Fixes satwikkansal#140
@satwikkansal satwikkansal self-assigned this Oct 29, 2019
@satwikkansal satwikkansal added this to the 3.0 milestone Oct 29, 2019
muscliary pushed a commit to muscliary/wtfpython that referenced this issue Sep 12, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants