Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools.target: use slots for Channel and User types #2233

Merged
merged 1 commit into from
Jan 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sopel/tools/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ class User:
:param str user: the user's local username ("user" in `user@host.name`)
:param str host: the user's hostname ("host.name" in `user@host.name`)
"""
__slots__ = (
'nick', 'user', 'host', 'channels', 'account', 'away',
)

def __init__(self, nick, user, host):
assert isinstance(nick, Identifier)
self.nick = nick
Expand Down Expand Up @@ -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
Expand Down