Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print() behavior change #473

Open
spaceone opened this issue Jun 4, 2019 · 0 comments
Open

print() behavior change #473

spaceone opened this issue Jun 4, 2019 · 0 comments

Comments

@spaceone
Copy link

spaceone commented Jun 4, 2019

$ cat print_failure.py 
print 'foo\n',
print 'bar\n',
$ python print_failure.py | xxd
00000000: 666f 6f0a 6261 720a                      foo.bar.
$ futurize -nw --no-diffs print_failure.py
$ cat print_failure.py 
from __future__ import print_function
print('foo\n', end=' ')
print('bar\n', end=' ')
$ python print_failure.py | xxd
00000000: 666f 6f0a 2062 6172 0a20                 foo. bar.

If the to be printed thing ends with a newline an additional space character is added to the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants