Skip to content

assert(Not)AlmostEqual(s) specifies the type as float #7891

Closed
@vnmabus

Description

@vnmabus

assert(Not)AlmostEqual(s) specifies the type as float or datetime.datetime, when in practice it works also with other types that support subtraction, absolute value, rounding and comparison with zero, such as Fraction or Decimal.

This should be fixed (using TypeVar and a Protocol) to prevent Mypy errors in tests that use these types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions