Skip to content

Switch all uses of print to be a function, not a statement #2841

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

Closed
wants to merge 1 commit into from
Closed

Switch all uses of print to be a function, not a statement #2841

wants to merge 1 commit into from

Conversation

alexwlchan
Copy link
Contributor

Picking up from Eric’s comment on #2819, this patch converts every use of print as a statement to be print() as a function.

Aimed at improving eventual Python 3 compatibility, without breaking anything on Python 2.7.

There is a pylint check for print-statement, but (1) I couldn't get it working, and (2) it wants you to add from __future__ import print_function everywhere, which is a bigger patch.

@agjohnson
Copy link
Contributor

I don't think we should ever have print statements in our code at all. Either the string should be logged properly or if it's debug data, just removed.

@agjohnson agjohnson added PR: work in progress Pull request is not ready for full review and removed PR: ready for review labels May 23, 2017
@agjohnson
Copy link
Contributor

agjohnson commented May 24, 2017

I'm going to close this PR because #2819 is closer to being merged and is larger. I'm trying to reduce the number of conflicts stemming from merging that. Feel free to create a PR that removes the print statements however!

@agjohnson agjohnson closed this May 24, 2017
@agjohnson agjohnson removed the PR: work in progress Pull request is not ready for full review label May 24, 2017
@alexwlchan alexwlchan deleted the print-function branch May 25, 2017 06:15
@alexwlchan
Copy link
Contributor Author

I'm going to close this PR because #2819 is closer to being merged and is larger. I'm trying to reduce the number of conflicts stemming from merging that.

👍

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

Successfully merging this pull request may close these issues.

2 participants