Commit fb8ce298 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Add missing equality check to BytesMessage

parent 0a026724
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -354,6 +354,11 @@ class BytesMessage(Message):
			f"{self.content[:20].tobytes()!r} + {len(self.content)-20} further bytes"
		return f"{self.__class__.__name__}({content})"

	def __eq__(self, other: object) -> bool:
		if not isinstance(other, type(self)):
			return NotImplemented
		return other.content == self.content

	@classmethod
	def from_buffer(cls: type[Self], buf: memoryview) -> Self:
		return cls(buf)