Skip to content

Incorrect division by zero error message #145902

@pb21314

Description

@pb21314

Bug report

Bug description:

Description

Division by zero should consistently raise a ZeroDivisionError in Python.
This issue reports an inconsistency in the current behavior where the resulting error message or handling is not aligned with the expected semantics of Python's arithmetic operations.

According to Python's specification, division by zero must raise a ZeroDivisionError to clearly indicate that the operation is mathematically undefined.

Reproduction

Minimal example:

10 / 0

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions