commit: 172b27b7fc2e0ff1bb40c4057c9678d5c8ca2a56
Author: Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Fri Nov 28 21:13:25 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=172b27b7
chore: slightly cleanup property usage of singleton
This needs to probably be reviewed closely for migration
to descriptors.
Signed-off-by: Brian Harring <ferringb <AT> gmail.com>
src/snakeoil/klass/properties.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/snakeoil/klass/properties.py b/src/snakeoil/klass/properties.py
index 82e471f..1142060 100644
--- a/src/snakeoil/klass/properties.py
+++ b/src/snakeoil/klass/properties.py
@@ -17,11 +17,17 @@ from snakeoil.deprecation import deprecated
from ..currying import post_curry
-class _singleton_kls:
+class kls:
+ __slots__ = ()
+
def __str__(self):
return "uncached singleton instance"
+_uncached_singleton = kls()
+del kls
+
+
def _internal_jit_attr(
func, attr_name, singleton=None, use_cls_setattr=False,
use_singleton=True, doc=None
):
@@ -97,8 +103,6 @@ class _raw_internal_jit_attr:
return obj
-_uncached_singleton = _singleton_kls
-
T = typing.TypeVar("T")