8000 MICROPY_PY_BUILTINS_ROUND_INT==0 breaks round(<int>, <n>) · Issue #4792 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content
MICROPY_PY_BUILTINS_ROUND_INT==0 breaks round(<int>, <n>) #4792
Open
@dhalbert

Description

@dhalbert

Before b318ebf, which was a rework of #3557, round(<int>, <n>) worked. Now, if MICROPY_PY_BUILTINS_ROUND_INT is set to 0, round(2, 2) or similar throws NotImplementedError. round(2) still works.

@dpgeorge Was it your intention to disable rounding of integers in this way completely, instead of just not handling negative values for the second arg if it was an int?

A user discovered this after ending up with an integer zero while doing some floating arithmetic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0