Skip to content

[spec] Document NotImplemented special casing? #2109

Open

Description

@randolf-scholz

Type checkers and typeshed special case NotImplemented to be treated as Any, this appears to be not documented in the spec currently.

A small paragraph should probably go here: https://typing.python.org/en/latest/spec/special-types.html

Activity

  1. added and removed on Nov 2, 2025
  2. tyralla commented on Nov 7, 2025

    @tyralla

    I am not aware of a case where treating NotImplemented as Any is really useful, and recently opened python/mypy#20114 to remove this special casing from Mypy. An idea is to use NotImplemented / NotImplementedType to specify the behaviour of binary operators as discussed in #1548.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions