- Notifications
You must be signed in to change notification settings - Fork3.8k
Added__round__ method for vectors#3559
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Why is this failing on a font test? |
What? Those tests didn't fail this time. |
This will need a note in the documentation that this was added in pygame 2.1.4. |
Matiiss commentedNov 13, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
That's what I thought, the question is where in the docs should this be added? I suppose it's not exactly a separate method, because it's not intended to be called like Perhaps, something like this because Also, I just realized that that line aboutrequired import is a bit confusing, isrequired import what changed in 1.9.4 (as in, is no more required) or is it required as of 1.9.4 (because AFAIK it's not required)? |
Matiiss commentedNov 13, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Should this support keyword arguments? |
It should try to emulate a normal numerical The docs addition you bring up makes sense. |
Matiiss commentedNov 13, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
It is a bit odd to do this though |
Should the docs say that this is new in version 2.1.4.dev1? |
oddbookworm commentedNov 17, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I think it'd be fine saying just 2.1.4 |
Uh oh!
There was an error while loading.Please reload this page.
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.
math.rst line 16 has a description of all the numerical operations Vectors support, it would be good to add support forround to that list.
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.
Left a couple more comments for consideration before merge, but the code and functionality looks great. Good job!
Uh oh!
There was an error while loading.Please reload this page.
Did I just... |
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.
needs a few memory leak fixes. See#3590 for more details.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
+ tests (taken fromhttps://github.com/python/cpython/blob/c32bc1bffd9d63ede0d0505abab983247a3ad0c6/Lib/test/test_builtin.py#L1477)Fixes#3523Added type stubsAdded `__round__` method for vectorsFix FASTCALL issues by replacing with METH_VARARGSFixed weird tabAdded change to docsTabs to spacesUpdate math.cSeparated `||` into 2 `if`s, removed an unreasonable check since `ndigits` will equal -1 if user provides that value.Update math.rstAdded `round` to numerical operation listFixed conflictMinor `pygame.math` doc enhancementsDoc additionsAdded `Py_DECREF(ret);`
@MyreMylar I have made the requested changes, it would be great if you could review them, 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.
LGTM 👍


Uh oh!
There was an error while loading.Please reload this page.
+ tests (taken fromhttps://github.com/python/cpython/blob/c32bc1bffd9d63ede0d0505abab983247a3ad0c6/Lib/test/test_builtin.py#L1477)
Fixes#3523
Added type stubs