assert(Not)AlmostEqual(s)
specifies the type as float
#7891
Labels
stubs: false positive
Type checkers report false errors
assert(Not)AlmostEqual(s)
specifies the type asfloat
ordatetime.datetime
, when in practice it works also with other types that support subtraction, absolute value, rounding and comparison with zero, such asFraction
orDecimal
.This should be fixed (using
TypeVar
and aProtocol
) to prevent Mypy errors in tests that use these types.The text was updated successfully, but these errors were encountered: