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

Class NotAValueClass

tests/_common.py:167–188  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

165###
166# Utility classes
167class NotAValueClass(object):
168 """
169 A class analogous to NaN that has operations defined for any type.
170 """
171 def _op(self, other):
172 return self # Operation with NotAValue returns NotAValue
173
174 def _cmp(self, other):
175 return False
176
177 __add__ = __radd__ = _op
178 __sub__ = __rsub__ = _op
179 __mul__ = __rmul__ = _op
180 __div__ = __rdiv__ = _op
181 __truediv__ = __rtruediv__ = _op
182 __floordiv__ = __rfloordiv__ = _op
183
184 __lt__ = __rlt__ = _op
185 __gt__ = __rgt__ = _op
186 __eq__ = __req__ = _op
187 __le__ = __rle__ = _op
188 __ge__ = __rge__ = _op
189
190
191NotAValue = NotAValueClass()

Callers 1

_common.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected