8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 887d3a7 commit 9e5ec95Copy full SHA for 9e5ec95
msgpack/ext.py
@@ -36,6 +36,8 @@ class Timestamp(object):
36
37
When built with Cython, msgpack uses C methods to pack and unpack `Timestamp`. When using pure-Python
38
msgpack, :func:`to_bytes` and :func:`from_bytes` are used to pack and unpack `Timestamp`.
39
+
40
+ This class is immutable: Do not override seconds and nanoseconds.
41
"""
42
43
__slots__ = ["seconds", "nanoseconds"]
@@ -78,9 +80,8 @@ def __eq__(self, other):
78
80
)
79
81
return False
82
- def __ne__(self, other):
- """not-equals method (see :func:`__eq__()`)"""
83
- return not self.__eq__(other)
+ def __hash__(self):
84
+ return hash((self.seconds, self.nanoseconds))
85
86
@staticmethod
87
def from_bytes(b):
0 commit comments