Skip to content

Regression: types.NotImplementedType considered @type_check_only #14965

@randolf-scholz

Description

@randolf-scholz

#14717 marked _NotImplementedType as @type_check_only, this causes typing errors when types.NotImplementedType is used in runtime context Code sample in pyright playground

from types import NotImplementedType

assert isinstance(NotImplemented, NotImplementedType)
# "_NotImplementedType" is marked as @type_check_only and can be used only in type annotations  (reportGeneralTypeIssues)

(this checked fine with pyright 1.1.405 which uses older stub version)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions