Issue 28458: from future import print_function does not emulate the flush param from py3k (original) (raw)

Issue28458

Created on 2016-10-17 07:56 by Attila-Mihaly Balazs, last changed 2022-04-11 14:58 by admin. 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
2022-04-11 14:58:38 admin set github: 72644
2016-10-17 08:07:26 berker.peksag set status: open -> closednosy: + berker.peksagmessages: + resolution: not a bugstage: resolved
2016-10-17 07:56:45 Attila-Mihaly Balazs create