-
-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2233 from sopel-irc/target-slots
tools.target: use slots for Channel and User types
- Loading branch information
Showing
1 changed file
with
8 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,10 @@ class User: | |
:param str user: the user's local username ("user" in `[email protected]`) | ||
:param str host: the user's hostname ("host.name" in `[email protected]`) | ||
""" | ||
__slots__ = ( | ||
'nick', 'user', 'host', 'channels', 'account', 'away', | ||
) | ||
|
||
def __init__(self, nick, user, host): | ||
assert isinstance(nick, Identifier) | ||
self.nick = nick | ||
|
@@ -59,6 +63,10 @@ class Channel: | |
:param name: the channel name | ||
:type name: :class:`~.tools.Identifier` | ||
""" | ||
__slots__ = ( | ||
'name', 'users', 'privileges', 'topic', 'modes', 'last_who', 'join_time', | ||
) | ||
|
||
def __init__(self, name): | ||
assert isinstance(name, Identifier) | ||
self.name = name | ||
|