Skip to content

Change the string representation of the bottom type from <nothing> to typing.Never #15950

Closed

Description

@sirosen

Feature

Rather than showing the string <nothing>, which is unclear to mypy users, use typing.Never.

Pitch

It is not obvious to a typing user that <nothing> means the same thing as typing.Never.

I've been active in some other issues regarding a behavior which incorrectly produces <nothing>.
The originating issue which prompted my interest was a click bug (pallets/click#2558) which produced <nothing>.
I then made comments and filed issues (e.g. #15931) based on a significant misunderstanding of <nothing> (and I do apologize for burning people's time on this!).
Aligning the string from mypy with symbols in typing would have made the connection clear from the start.

Looking at how mypy renders other types from typing, I see typing.Any renders as Any, and typing.TextIO renders as typing.TextIO.
So there is precedent for either Never or typing.Never.

Activity

  1. added a commit that references this issue on Aug 30, 2023
    7c012a3
  2. added a commit that references this issue on Aug 31, 2023
    df4717e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions