You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression: types.NotImplementedType considered @type_check_only #14965
#14717 marked _NotImplementedType as @type_check_only, this causes typing errors when types.NotImplementedType is used in runtime context Code sample in pyright playground
fromtypesimportNotImplementedTypeassertisinstance(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)
It probably makes sense to move _NotImplementedType to types, renaming it, and removing the @type_check_only marker. I'm not sure why it is in builtins.pyi in the first place, possibly for historic reasons.
Activity
srittau commentedon Nov 2, 2025
It probably makes sense to move
_NotImplementedTypetotypes, renaming it, and removing the@type_check_onlymarker. I'm not sure why it is inbuiltins.pyiin the first place, possibly for historic reasons.