MCPcopy Create free account
hub / github.com/dateutil/dateutil / NotAValueClass

Class NotAValueClass

tests/_common.py:287–307  ·  view source on GitHub ↗

A class analogous to NaN that has operations defined for any type.

Source from the content-addressed store, hash-verified

285###
286# Utility classes
287class NotAValueClass:
288 """
289 A class analogous to NaN that has operations defined for any type.
290 """
291 def _op(self, other):
292 return self # Operation with NotAValue returns NotAValue
293
294 def _cmp(self, other):
295 return False
296
297 __add__ = __radd__ = _op
298 __sub__ = __rsub__ = _op
299 __mul__ = __rmul__ = _op
300 __truediv__ = __rtruediv__ = _op
301 __floordiv__ = __rfloordiv__ = _op
302
303 __lt__ = __rlt__ = _op
304 __gt__ = __rgt__ = _op
305 __eq__ = __req__ = _op
306 __le__ = __rle__ = _op
307 __ge__ = __rge__ = _op
308
309
310NotAValue = NotAValueClass()

Callers 1

_common.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected