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
Update annotation for pygame.Surface.blits() (and some other tidy ups) #2697
Conversation
Updated annotation for pygame.Surface.blits() to correct the keyword usage and expected parameters
Further update to annotation for pygame.Surface.blits() expected parameters
This is to fix issue #2693 |
OK thanks, working on this, just having a problem with |
I've made the updates but I can't seem to regenerate the docs, I get errors on both my Windows machine and my Mac when I run |
Uh, that's weird. setup.py docs should just build the docs, not pygame. I think the types look good now. For the docs I was thinking you would have to add an |
Oh man, yeah you're right, sorry. I only recently started using Black to format my code correctly and I misread the number of The issues with running |
I've taken a closer look at the error I'm getting on my Windows machine and the first line starts with I assume it's then trying to build pygame rather than just the docs. |
Added a few minor updates to annotations in mixer.pyi, also corrected a couple of minor typos in the mixer docs. |
docs/reST/ref/surface.rst
Outdated
@@ -134,8 +134,8 @@ | |||
|
|||
| :sl:`draw many images onto another` | |||
| :sg:`blits(blit_sequence=(source, dest), ...), doreturn=1) -> [Rect, ...] or None` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one still needs another parenthesis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow I didn't even notice that one! Thanks.
buildconfig/pygame-stubs/mixer.pyi
Outdated
@@ -19,7 +19,7 @@ def init( | |||
buffer: int = 512, | |||
devicename: Optional[str] = None, | |||
allowedchanges: int = 5, | |||
) -> None: ... | |||
) -> True: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably returns whether init was successful, not just True.
Also, if you're going to fix that you've got to fix the docs too, because they say it returns None.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My fault, getting mixed up with which changes I'd made as I was looking at my fork on 2 different machines, think I committed the wrong one as the other one I'd changed to bool, not True. Also updated docs, apologies. I feel like a noob!
Minor updates to docs for mixer and surface.
Alright, I opened a broader issue about the mixer.init() thing, #2702, so I think it would be best to take the mixer.init() docs and types changes out of this PR. Thanks for pointing that out though. I think it should be fixed across several modules, by changing the code to match the docs, rather than the other way around. And the parentheses should be after Also I guess I need to fix |
Reverted changes for mixer docs and types and fixed parentheses in surface.blits docs. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to go! Thanks for the PR! 🎈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me as well. 👍
Thanks for contributing!
Updated annotation for pygame.Surface.blits() to correct the keyword used and expected parameters.