Stefan Behnel wrote:
> Hi,
> 
> Dag Sverre Seljebotn wrote:
>> There's a problem if you do an empty print (newline
>> print) right after a non-newline print. The attached test case works in
>> Py2 but fails in Py3 (the line with "2 2 2" is output as "2 2 2 " instead).
> 
>> for i in range(3):
>>        print 2,
>> print
> 
> Right, that makes sense. The Py3 print() function (that we map the print
> statement to when running under Py3) has an explicit 'end' keyword that keeps
> it from having to do any "softspace" special casing. So this is a difference
> that is hard to emulate in Py3, which (as opposed to Py2) does not expose the
> softspace hint at all.
> 
> http://www.python.org/dev/peps/pep-3105/
> 
> Open poll:
> 
> a) would it be acceptable if this difference persisted, i.e. if Cython code
>    that uses something like the example above would behave different in Py3
> b) should Cython try to special case this in Py3 to emulate the Py2 behaviour
>    in common cases

+1; though it ends up on the list of priorities we all keep in the back 
of our head and then it is sure to end up pretty low :-) But I think 
this is the optimal option.

-- 
Dag Sverre
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to