Skip to content

Useless code block in math.trunc() ?#111417

@skirpichev

Description

@skirpichev

Bug report

Bug description:

The math.trunc function has:

if (!_PyType_IsReady(Py_TYPE(x))){
if (PyType_Ready(Py_TYPE(x)) <0)
returnNULL;
}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions