8000 Add parentheses to print so it works in py2 and py3 by Pierre-Sassoulas · Pull Request #2284 · pygame/pygame · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add parentheses to print so it works in py2 and py3 #2284

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

8000
Merged

Conversation

Pierre-Sassoulas
Copy link
Contributor
@Pierre-Sassoulas Pierre-Sassoulas commented Oct 31, 2020

print("foo") works in both python2 and python3. except Exception as e: too. The python2 only syntax prevented mypy from running on the codebase for #1896 .

@Pierre-Sassoulas Pierre-Sassoulas force-pushed the upgrade-svn_log_to_whatsnew.py-to-py3 branch from e23b9a2 to 479179e Compare October 31, 2020 09:57
@ankith26
Copy link
Contributor
ankith26 commented Oct 31, 2020

Welcome :)
Noticed that your other PR #2285 makes the same changes that this PR makes, so this PR is kinda redundant ??

@Pierre-Sassoulas
Copy link
Contributor Author

Good catch, #2285 need this, but it is more of a proposition to discuss and could be rebased when this is merged. I wanted to separate the various issues and have manageable review for maintainers :) I also expect the compat between python 2 and 3 to be easier to merge because I think it's non controversial.

@ankith26
Copy link
Contributor

Yes you are right, this PR is easier to approve.
The code you have updated in this PR was mostly old, unused code.
But still, thanks for the contribution :)

@MyreMylar
Copy link
Contributor
MyreMylar commented Oct 31, 2020

As a note we can delete svn_log_to_whatsnew.py since pygame is no longer using svn and will not return.

I'm not as sure if gen_stubs.py (and the other connected .py files in the util sub-directory) are still useful. Theoretically gen_stubs.py is there to make unit test stubs whenever somebody makes a new pygame module. However, clearly that has not happened for some time. As well as it being written in the python 2 style, several of the imports it was relying on now no longer function.

I think on balance it would be useful if it worked for 2.1+ so I think raising an issue to investigate seeing if gen_stubs.py can be made functional again is the right way forward. It has documentation in the README.TXT so it's not a completely impossible task.

EDIT: I will raise these issues.

Copy link
Contributor
@MyreMylar MyreMylar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! 👍

@Pierre-Sassoulas Pierre-Sassoulas deleted the upgrade-svn_log_to_whatsnew.py-to-py3 branch May 8, 2021 09:15
@illume illume added the Linters Related to code linting issues or solutions label Aug 21, 2021
@illume illume added this to the 2.0.1 milestone Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linters Related to code linting issues or solutions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0