Uh oh!
There was an error while loading. Please reload this page.
Use print() function in both Python 2 and Python 3 - #2234
Conversation
Legacy __print__ statements are syntax errors in Python 3 but __print()__ function works as expected in both Python 2 and Python 3.
gguuss
left a comment
There was a problem hiding this comment.
Mostly LGTM, I think you can get by without the print future and it's preferred to use single-quote strings / string formatter.
Uh oh!
There was an error while loading. Please reload this page.
| if l.startswith('Plural-Forms:'): | ||
| plural = l.split(':', 1)[1].strip() | ||
| print"plural is %s" % plural | ||
| print("plural is %s" % plural) |
There was a problem hiding this comment.
Prefer string formatter and single quotes:
print(`plural is {}`.format(plural))
There was a problem hiding this comment.
python/black (think gofmt for Python) is reformatting code to prefer " over ' but I will make the requested change.
There was a problem hiding this comment.
We'll consider this alternative style; I don't personally have a strong opinion either way. Thank you for the pointers, also thanks a ton for the fixes!
There was a problem hiding this comment.
Regarding python/black and quotes, according to the style guide it looks like some teams are using yapf.
Uh oh!
There was an error while loading. Please reload this page.
gguuss
commented
Aug 19, 2019
@cclauss Friendly ping, happy to accept your enhancements once you've applied the style we prefer. |
Legacy print statements are syntax errors in Python 3 but print() function works as expected in both Python 2 and Python 3.