Nick Coghlan added the comment:

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=' '".

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30597>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to