Remove print statements within functions
Feature description
Use flake8-print plugin to check for print statements and remove them if found within variable scopes
I think this will be difficult to explain to new contributors.
I've run flake8 with flake8-print and the print statements I've checked are all in if __name__ == "__main__" blocks. They're mainly just used for running functions on user inputs. I assume these print statements should stay?
Yes, they can remain as they are. CONTRIBUTING.md says that algorithmic functions should not input(), print(), plot, or read/write to files. However, there might be __main__, or main(), or other utility functions that do these things.
Instead, I propose to make the following refactor:
For all the classes that provide some method to print out a representation of that object, use __str__ method to return the string representation instead. The caller then can do whatever he/she wants, print it, etc.
Hello sir, can u assign me this issue. I would love to grab this opportunity.
Please stop waiting. We do not assign issues in this repo. Instead, we review pull requests so if you see something that is worth fixing then please create a pull request to fix it. #7499 (merged) seems to have solved most of these problems.