-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Useless code block in math.trunc() ? #111417
Comments
Created a small PR to remove the unused code block - #111454 |
I suggested @skirpichev to open a separate issue for discussion and reference. Previously this change was hidden in a pile of unrelated changes. Now I think that it is safe. This check is immediately followed by I think that a similar code in the builtin |
@serhiy-storchaka, in the end, it was your commit, that makes additional @Jason-Y-Z, I think you could reference that commit in you commit message. And remove similar code in |
…11454) _PyObject_LookupSpecial() now ensures that the type is ready.
…pythonGH-111454) _PyObject_LookupSpecial() now ensures that the type is ready.
…pythonGH-111454) _PyObject_LookupSpecial() now ensures that the type is ready.
Bug report
Bug description:
The math.trunc function has:
cpython/Modules/mathmodule.c
Lines 2073 to 2076 in f013b47
c.f. math.ceil or math.floor.
This seems to be a history artifact: the function was introduced in 400adb0 as a moved builtins.trunc(), while math.ceil/floor were here from the initial revision.
I think it's safe to remove mentioned block.
PS: Issue opened per @serhiy-storchaka suggestion in #110000.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: