Skip to content

Fix math.lerp docs, improve code #3523

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

Merged
merged 1 commit into from
Jul 14, 2025
Merged

Fix math.lerp docs, improve code #3523

merged 1 commit into from
Jul 14, 2025

Conversation

ankith26
Copy link
Member

@ankith26 ankith26 commented Jul 1, 2025

This PR fixes #3521 by using the correct formula in the docs.

While I was looking at the code I decided to also improve it to not do PyNumber_Check because the subsequent PyFloat_AsDouble can still fail. The more robust way to do this is to check for errors after the call.

@ankith26 ankith26 requested a review from a team as a code owner July 1, 2025 18:11
Copy link
Member

@damusss damusss left a comment

Choose a reason for hiding this comment

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

Looking clean, thank you!

Copy link
Member

@Starbuck5 Starbuck5 left a comment

Choose a reason for hiding this comment

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

Thanks!

@Starbuck5 Starbuck5 added Code quality/robustness Code quality and resilience to changes docs math pygame.math labels Jul 14, 2025
@ankith26 ankith26 added this to the 2.5.6 milestone Jul 14, 2025
@ankith26 ankith26 merged commit 2ef1364 into main Jul 14, 2025
26 of 27 checks passed
@ankith26 ankith26 deleted the ankith26-lerp-fixes branch July 14, 2025 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code quality/robustness Code quality and resilience to changes docs math pygame.math
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Typo in pygame.math.lerp documentation formula
3 participants