diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-02-11 01:18:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-11 01:18:23 (GMT) |
commit | 1124ab6d1d15dc5058e03b63fd1d95e6f1009cc3 (patch) | |
tree | 39adcce7fac302098fdb513768645c1c04a09ed4 /Lib/importlib | |
parent | 14284b0e71c2110f94941b774478fb594d0ef192 (diff) | |
download | cpython-1124ab6d1d15dc5058e03b63fd1d95e6f1009cc3.zip cpython-1124ab6d1d15dc5058e03b63fd1d95e6f1009cc3.tar.gz cpython-1124ab6d1d15dc5058e03b63fd1d95e6f1009cc3.tar.bz2 |
bpo-46246: add missing __slots__ to importlib.metadata.DeprecatedList (GH-30452)
Confirmed with @jaraco that this indeed needs a fix.
A question that came up while I was digging into the code: I think `SelectableGroups` could similarly use `__slots__ = ()`, since its purpose seems only for convenience around `dict`, not to have attributes of its own.
Automerge-Triggered-By: GH:jaraco
(cherry picked from commit dd76b3f7d332dd6eced5cbc2ad2adfc397700b3d)
Co-authored-by: Arie Bovenberg <a.c.bovenberg@gmail.com>
Diffstat (limited to 'Lib/importlib')
-rw-r--r-- | Lib/importlib/metadata/__init__.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/importlib/metadata/__init__.py b/Lib/importlib/metadata/__init__.py index 33ce1b6..c7462f3 100644 --- a/Lib/importlib/metadata/__init__.py +++ b/Lib/importlib/metadata/__init__.py @@ -236,6 +236,8 @@ class DeprecatedList(list): 1 """ + __slots__ = () + _warn = functools.partial( warnings.warn, "EntryPoints list interface is deprecated. Cast to list if needed.", |