Skip to content

Commit

Permalink
irc: MyInfo namedtuple with proper type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
Exirel committed Jul 2, 2021
1 parent f1bc92d commit 41c6ce4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sopel/irc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the Eiffel Forum License 2.
from __future__ import generator_stop

import collections
from typing import NamedTuple

from dns import rdtypes, resolver

Expand Down Expand Up @@ -104,13 +104,14 @@ def module(self):
return self.plugin


class MyInfo(collections.namedtuple('MyInfo', MYINFO_ARGS)):
class MyInfo(NamedTuple):
"""Store client, servername, and version from ``RPL_MYINFO`` events.
.. seealso::
https://modern.ircdocs.horse/#rplmyinfo-004
"""
# TODO: replace by a class using typing.NamedTuple (new in Python 3.5+)
# probably in Sopel 8.0 (due to drop most old Python versions)
client: str
servername: str
version: str

0 comments on commit 41c6ce4

Please sign in to comment.