aboutsummaryrefslogtreecommitdiff
path: root/tools/cru-py/cru/util/_const.py
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2024-11-11 01:12:29 +0800
committerYuqian Yang <crupest@crupest.life>2024-12-18 18:31:27 +0800
commitaaa855e3839130a79193f38969f07763f2773c5d (patch)
treee4cb238df4588f4633d9c1190136895865d51a98 /tools/cru-py/cru/util/_const.py
parent95da3ade5bfa6ef39923cd3fc2a551ad983c1537 (diff)
downloadcrupest-aaa855e3839130a79193f38969f07763f2773c5d.tar.gz
crupest-aaa855e3839130a79193f38969f07763f2773c5d.tar.bz2
crupest-aaa855e3839130a79193f38969f07763f2773c5d.zip
HALF WORK: 2024.11.27
Diffstat (limited to 'tools/cru-py/cru/util/_const.py')
-rw-r--r--tools/cru-py/cru/util/_const.py56
1 files changed, 0 insertions, 56 deletions
diff --git a/tools/cru-py/cru/util/_const.py b/tools/cru-py/cru/util/_const.py
deleted file mode 100644
index 8140988..0000000
--- a/tools/cru-py/cru/util/_const.py
+++ /dev/null
@@ -1,56 +0,0 @@
-from typing import Any
-
-from ._cru import CRU
-
-
-def cru_make_unique_object() -> Any:
- class _CruUnique:
- _i = False
-
- def __init__(self):
- if self._i:
- raise ValueError("_CruAttrNotSet is a singleton!")
- self._i = True
-
- def __copy__(self):
- return self
-
- def __eq__(self, other):
- return isinstance(other, _CruUnique)
-
- v = _CruUnique()
-
- return v
-
-
-def cru_make_bool_unique_object(b: bool) -> Any:
- class _CruBoolUnique:
- _i = False
-
- def __init__(self):
- super().__init__(b)
- if self._i:
- raise ValueError("_CruAttrNotSet is a singleton!")
- self._i = True
-
- def __copy__(self):
- return self
-
- def __eq__(self, other):
- return isinstance(other, _CruBoolUnique) or b == other
-
- def __bool__(self):
- return b
-
- v = _CruBoolUnique()
-
- return v
-
-
-CRU_NOT_FOUND = cru_make_bool_unique_object(False)
-CRU_USE_DEFAULT = cru_make_unique_object()
-CRU_DONT_CHANGE = cru_make_unique_object()
-CRU_PLACEHOLDER = cru_make_unique_object()
-
-CRU.add_objects(cru_make_unique_object, cru_make_bool_unique_object, CRU_NOT_FOUND, CRU_USE_DEFAULT,
- CRU_DONT_CHANGE, CRU_PLACEHOLDER)