joythief.numbers module

Matchers for numeric types (e.g. float).

class joythief.numbers.NaN(*args, **kwargs)[source]

Bases: Matcher[float]

Matches any float instance representing NaN.

IEEE 754 NaN (“not a number”) instances are, by definition, not equal to each other. This matcher compares equal to e.g. math.nan or float("nan") using math.isnan().

Originally formulated for this answer.

Parameters:
  • args (tp.Any)

  • kwargs (tp.Any)