From cd4c9f82fc8d17726baa4b4a69c54151fb181f40 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 6 Dec 2020 16:34:52 +0100 Subject: Remove OrderedDict usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We now support only Python 3.7+, this means we can rely on dict being ordered by order of insertion, and thus no need to use OrderedDict from collections. --- slixmpp/xmlstream/stanzabase.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'slixmpp/xmlstream/stanzabase.py') diff --git a/slixmpp/xmlstream/stanzabase.py b/slixmpp/xmlstream/stanzabase.py index 925f2abc..141197ba 100644 --- a/slixmpp/xmlstream/stanzabase.py +++ b/slixmpp/xmlstream/stanzabase.py @@ -21,7 +21,6 @@ from xml.etree import ElementTree as ET from slixmpp.xmlstream import JID from slixmpp.xmlstream.tostring import tostring -from collections import OrderedDict log = logging.getLogger(__name__) @@ -392,7 +391,7 @@ class ElementBase(object): #: An ordered dictionary of plugin stanzas, mapped by their #: :attr:`plugin_attrib` value. - self.plugins = OrderedDict() + self.plugins = {} self.loaded_plugins = set() #: A list of child stanzas whose class is included in @@ -541,7 +540,7 @@ class ElementBase(object): .. versionadded:: 1.0-Beta1 """ - values = OrderedDict() + values = {} values['lang'] = self['lang'] for interface in self.interfaces: if isinstance(self[interface], JID): @@ -726,8 +725,6 @@ class ElementBase(object): if lang and attrib in self.lang_interfaces: kwargs['lang'] = lang - kwargs = OrderedDict(kwargs) - if attrib in self.interfaces or attrib == 'lang': if value is not None: set_method = "set_%s" % attrib.lower() @@ -813,8 +810,6 @@ class ElementBase(object): if lang and attrib in self.lang_interfaces: kwargs['lang'] = lang - kwargs = OrderedDict(kwargs) - if attrib in self.interfaces or attrib == 'lang': del_method = "del_%s" % attrib.lower() @@ -929,7 +924,7 @@ class ElementBase(object): name = self._fix_ns(name) default_lang = self.get_lang() - results = OrderedDict() + results = {} stanzas = self.xml.findall(name) if stanzas: for stanza in stanzas: -- cgit v1.2.3