commit: beaaa8688a15918dbd2d4333630a7b5f421b026f
Author: Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Tue Nov 25 11:24:08 2025 +0000
Commit: Brian Harring <ferringb <AT> gmail <DOT> com>
CommitDate: Fri Nov 28 22:32:35 2025 +0000
URL:
https://gitweb.gentoo.org/proj/pkgcore/snakeoil.git/commit/?id=beaaa868
chore: add missing slotting to containers
Signed-off-by: Brian Harring <ferringb <AT> gmail.com>
src/snakeoil/containers.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/snakeoil/containers.py b/src/snakeoil/containers.py
index 0660207..13c0063 100644
--- a/src/snakeoil/containers.py
+++ b/src/snakeoil/containers.py
@@ -33,6 +33,8 @@ class InvertedContains(set):
infinite series it represents.
"""
+ __slots__ = ()
+
def __contains__(self, key):
return not set.__contains__(self, key)
@@ -53,6 +55,8 @@ class SetMixin:
"""
+ __slots__ = ()
+
def __and__(self, other, kls=None):
# Note: for these methods we don't bother to filter dupes from this
# list - since the subclasses __init__ should already handle this,
@@ -110,6 +114,15 @@ class LimitedChangeSet(SetMixin):
"""
+ __slots__ = (
+ "_new",
+ "_validater",
+ "_blacklist",
+ "_changed",
+ "_change_order",
+ "_orig",
+ )
+
_removed = 0
_added = 1
@@ -228,6 +241,8 @@ class ProtectedSet(SetMixin):
>>> assert 2 not in protected
"""
+ __slots__ = ("_orig", "_new")
+
def __init__(self, orig_set):
self._orig = orig_set
self._new = set()
@@ -264,6 +279,8 @@ class RefCountingSet(dict):
>>> assert list(myset) == []
"""
+ __slots__ = ()
+
def __init__(self, iterable=None):
if iterable is not None:
self.update(iterable)