Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits: 03bbb2fa by lovetox at 2021-03-06T16:04:59+01:00 Roster: Use a set for groups
- - - - -
1 changed file:
- nbxmpp/structs.py
Changes:
===================================== nbxmpp/structs.py ===================================== @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program; If not, see http://www.gnu.org/licenses/.
-from typing import List +from typing import Set
import time import random @@ -143,7 +143,7 @@ class RosterItem: name: str = None ask: str = None subscription: str = None - groups: List[str] = field(default_factory=list) + groups: Set[str] = field(default_factory=set)
@classmethod def from_node(cls, node): @@ -156,7 +156,7 @@ class RosterItem: attrs['jid'] = jid
groups = {group.getData() for group in node.getTags('group')} - attrs['groups'] = list(groups) + attrs['groups'] = set(groups)
return cls(**attrs)
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/03bbb2fafe30652c905beb490...