This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients CuriousLearner, eric.smith, ncoghlan
Date 2017-06-09.04:33:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1496982790.99.0.785945710958.issue30597@psf.upfronthosting.co.za>
In-reply-to
Content
Ah, re-reading the comments when reviewing Sanyam's patch, I just remembered the problem with the "print >> sys.stderr, output" case, which is that it isn't a syntax error, it's a runtime type error:

```
>>> print >> sys.stderr, "message"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and '_io.TextIOWrapper'
```

So if we ever wanted to provide a specialised prompt for that, it would need to go into the right-shift operator implementation as a final check before raising the type error, rather than here.

That reduces the cases we need to handle here to just the default one and the softspace one, where a trailing comma in the statement text gets replaced with ", end=' '".
History
Date User Action Args
2017-06-09 04:33:11ncoghlansetrecipients: + ncoghlan, eric.smith, CuriousLearner
2017-06-09 04:33:10ncoghlansetmessageid: <1496982790.99.0.785945710958.issue30597@psf.upfronthosting.co.za>
2017-06-09 04:33:10ncoghlanlinkissue30597 messages
2017-06-09 04:33:10ncoghlancreate