Skip to content

regression: type alias for NoReturn no longer works as a type annotation #11903

Closed

Activity

  1. changed the title [-]type alias for `NoReturn` no longer works as a type annotation[/-] [+]regression: type alias for `NoReturn` no longer works as a type annotation[/+] on Jan 5, 2022
  2. hauntsaninja commented on Jan 5, 2022

    @hauntsaninja
    Collaborator

    Thanks for the report. I think this is a side effect of python/typeshed#6290

    Not seriously suggesting this, but a fun workaround happens to be from mypy_extensions import NoReturn, since I did a slightly different thing in python/typeshed#6595

  3. hauntsaninja commented on Jan 5, 2022

    @hauntsaninja
    Collaborator

    Btw, if you have a repo with code that contains this, let me know and I'll add it to mypy primer so these regressions don't happen in the first place :-)

  4. sobolevn commented on Jan 5, 2022

    @sobolevn
    Member

    Because I have literally 100s other issues to fix, I am playing around with this one 🤔

  5. AlexWaygood commented on Jan 5, 2022

    @AlexWaygood
    Member

    Here's another workaround that works fine on 0.930:

    from typing import NoReturn as Never
    from typing import NoReturn
    
    a: Never  # no error
    b: NoReturn  # no error 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions