3 ms·
The first really has nothing to do with `print` being a statement - it could be parsed and passed as a function in "non-statement" positions regardless. The re
by tomp 12y ago
The first really has nothing to do with `print` being a statement - it could be parsed and passed as a function in "non-statement" positions regardless.
The rest could probably be special-cased in a backwards-compatible way as well. This is currently not valid Python 2.0 syntax:
print "cats", end='', file=sys.stderr
- shabble 12y agowell, as a statement it's also a reserved keyword, so you can't override or mock it (AFAIK), and I suspect changing the parser to identify context and operate accordingly might be rather painful. Honestly, I'm reasonably happy with the split; there don't seem to be many compelling reasons to shoehorn all the extra bits back into statement-print other than a) removing a single pair of parens b) being backwards compatible (but then the old code wouldn't be using those new features anyway, and would still have to support that nasty bitshift hack.