Remove OrderedDict from entity_values as dict guarantees order on newer cpython (#118081)

This commit is contained in:
J. Nick Koston 2024-05-24 17:43:20 -10:00 committed by GitHub
parent f026083712
commit 3416162fdb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,7 +2,6 @@
from __future__ import annotations from __future__ import annotations
from collections import OrderedDict
import fnmatch import fnmatch
from functools import lru_cache from functools import lru_cache
import re import re
@ -36,9 +35,9 @@ class EntityValues:
if glob is None: if glob is None:
compiled: dict[re.Pattern[str], Any] | None = None compiled: dict[re.Pattern[str], Any] | None = None
else: else:
compiled = OrderedDict() compiled = {
for key, value in glob.items(): re.compile(fnmatch.translate(key)): value for key, value in glob.items()
compiled[re.compile(fnmatch.translate(key))] = value }
self._glob = compiled self._glob = compiled