From 51d91c2a82e01275d1c1d888319f1db14dc11791 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 17 Dec 2015 00:30:08 -0500 Subject: Most data classes now support hashing. --- discord/channel.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'discord/channel.py') diff --git a/discord/channel.py b/discord/channel.py index 983b4fb9..5f53b837 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -28,11 +28,11 @@ from . import utils from .permissions import Permissions from .enums import ChannelType from collections import namedtuple -from .mixins import EqualityComparable +from .mixins import Hashable Overwrites = namedtuple('Overwrites', 'id allow deny type') -class Channel(EqualityComparable): +class Channel(Hashable): """Represents a Discord server channel. Supported Operations: @@ -44,6 +44,8 @@ class Channel(EqualityComparable): +-----------+---------------------------------------+ | x != y | Checks if two channels are not equal. | +-----------+---------------------------------------+ + | hash(x) | Returns the channel's hash. | + +-----------+---------------------------------------+ | str(x) | Returns the channel's name. | +-----------+---------------------------------------+ @@ -196,7 +198,7 @@ class Channel(EqualityComparable): return base -class PrivateChannel(EqualityComparable): +class PrivateChannel(Hashable): """Represents a Discord private channel. Supported Operations: @@ -208,6 +210,8 @@ class PrivateChannel(EqualityComparable): +-----------+-------------------------------------------------+ | x != y | Checks if two channels are not equal. | +-----------+-------------------------------------------------+ + | hash(x) | Returns the channel's hash. | + +-----------+-------------------------------------------------+ | str(x) | Returns the string "Direct Message with " | +-----------+-------------------------------------------------+ -- cgit v1.2.3