classification
Title: from __future__ import print_function does not emulate the flush param from py3k
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Attila-Mihaly Balazs, berker.peksag
Priority: normal Keywords:

Created on 2016-10-17 07:56 by Attila-Mihaly Balazs, last changed 2016-10-17 08:07 by berker.peksag. This issue is now closed.

Messages (2)
msg278797 - (view) Author: Attila-Mihaly Balazs (Attila-Mihaly Balazs) Date: 2016-10-17 07:56
Doing the following in Python 2.7.12 does not work:

from __future__ import print_function
print(1, flush=True)

It says: "'flush' is an invalid keyword argument for this function"

While the following is a perfectly valid python 3k statement:

print(1, flush=True)
msg278798 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-10-17 08:07
That's because the flush argument was added in Python 3.3 (after print() was backported to 2.7 via a future import)

Thanks for the report.
History
Date User Action Args
2016-10-17 08:07:26berker.peksagsetstatus: open -> closed

nosy: + berker.peksag
messages: + msg278798

resolution: not a bug
stage: resolved
2016-10-17 07:56:45Attila-Mihaly Balazscreate