wrongly reported typing error in min
with key
lambda function and default value when result is Optional
#17221
Labels
bug
mypy got something wrong
min
with key
lambda function and default value when result is Optional
#17221
Bug Report
When using
key
function inmin
builtin function, default None value and returning it from a function which has anOptional
type, mypy reports a problem where I believe there is none.To Reproduce
Expected Behavior
No errors reported.
Actual Behavior
The error goes away if I remove the
default=None
or when themin
is not in a function withX | None
return type:Here, mypy complains only about
get_min_1
:Your Environment
mypy.ini
(and other config files): (no config)The text was updated successfully, but these errors were encountered: