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
Fixed in #22503: functions use builtins.function as their fallback, which is the same runtime type as types.FunctionType, so the subtype check in mypy/subtypes.py now treats it as a subtype. The repro now reports no issues, and passing a non-function (e.g. int) is still rejected.
Activity
zhengdaodeguL commentedon Nov 17, 2026
Fixed in #22503: functions use
builtins.functionas their fallback, which is the same runtime type astypes.FunctionType, so the subtype check inmypy/subtypes.pynow treats it as a subtype. The repro now reports no issues, and passing a non-function (e.g.int) is still rejected.