# from math import nan
# print([nan].count(nan))  # 1
#
# nanf = float('nan')
# print([nanf].count(nanf))  # 1
#
# print([nan].count(float('nan')))  # 0
# print([nanf].count(float('nan')))  # 0


class Reflexive:
  def __eq__(self, _):
    return True


class Irreflexive:
  def __eq__(self, _):
    return False


r1 = Reflexive()
r2 = Reflexive()
i1 = Irreflexive()
i2 = Irreflexive()

# `list.count` uses `PyObject_RichCompareBool` to compare elements, which acts similarly to `self is other or self == other`; if `self is other` then all other comparison mechanisms are hijacked. sketchy as hell
print([r1].count(r1))  # 1
print([r1].count(r2))  # 1
print([i1].count(i1))  # 1
print([i1].count(i2))  # 0
