Skip to content

Move mouse and key docs to stubs - #3441

Merged
ankith26 merged 4 commits into
pygame-community:mainfrom
zoldalma999:move-mouse-docs
Jun 14, 2025
Merged

ankith26 merged 4 commits into
pygame-community:mainfrom
zoldalma999:move-mouse-docs

Conversation

@zoldalma999

Copy link
Copy Markdown
Member

@zoldalma999
zoldalma999 requested a review from a team as a code owner May 24, 2025 10:53

@ankith26 ankith26 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM thanks for the PR 🎉

@aatle

aatle commented May 26, 2025

Copy link
Copy Markdown
Member

Tests are failing due to the overloaded functions mouse.get_pos(), mouse.set_pos(), and mouse.set_cursor() having an implementation (last, non-@overload) definition inside a stub file, which is typically unnecessary. Note that this is a mypy error, not a stubtest one.
I see that it was added in order to include the docstring.

There's no standard place to put the docstring for this case.
If it were placed on the last overload, then some tools assume that the other overloads have no docstring.

@aatle

aatle commented May 26, 2025

Copy link
Copy Markdown
Member

I think a type: ignore[misc] comment can be added after the header of each implementation definition.

@ankith26 ankith26 added this to the 2.5.6 milestone Jun 7, 2025
Comment thread buildconfig/stubs/pygame/mouse.pyi Resolved

@aatle aatle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Co-authored-by: aatle <168398276+aatle@users.noreply.github.com>
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.

3 participants