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

Bugs/color should support long #44

Merged
merged 4 commits into from
Feb 8, 2016
Merged

Conversation

drnlm
Copy link
Member

@drnlm drnlm commented Feb 8, 2016

pygame.color.Color() should allow a long as input on python 2.

The test suites claims to test that this works, but this is only true on 32-bit platforms, so fix that as well.

Neil added 3 commits February 8, 2016 14:49
The long/int tests only do what they claims to do on 32-bit
platforms, which is less than ideal, so we add explicit
casts to test the behaviour we actually trying to test.
g = (arg >> 16) & 0xff
b = (arg >> 8) & 0xff
a = arg & 0xff
if isinstance(arg, int) or isinstance(arg, long_):
Copy link
Member

Choose a reason for hiding this comment

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

Can this be if isinstance(arg, (int, long_))?

@hodgestar
Copy link
Member

Very minor improvement suggested. Otherwise 👍

drnlm added a commit that referenced this pull request Feb 8, 2016
@drnlm drnlm merged commit aaf1413 into master Feb 8, 2016
@drnlm drnlm deleted the bugs/color_should_support_long branch February 8, 2016 14:57
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