Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Make ZeroDivisionError message more precise when floor-dividing by zero #119057

Copy link
Copy link
@E8zEbo8Luna

Description

@E8zEbo8Luna
Issue body actions

Feature or enhancement

Proposal:

try:
  10 // 0
except ZeroDivisionError as e:
  print(e) #returns integer division or modulo by zero

try:
  10 / 0
except ZeroDivisionError as e:
  print(e) #returns integer division by zero

try:
  10 % 0
except ZeroDivisionError as e:
  print(e) #returns integer modulo by zero

When floor dividing by zero the error says "division or modulo" but while (non-floor) dividing by zero or modulo-ing (?) it is more specific saying "division" or "modulo". I would recommend changing this to "floor division" or "division" because it would help with knowing what exactly the error is talking about.

Thank You!

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.