scaevola 1.1.1__py3-none-any.whl → 1.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scaevola/core/__init__.py +11 -33
- scaevola/core/cfg.toml +64 -20
- scaevola/tests/test_slots_Scaevola.py +0 -2
- {scaevola-1.1.1.dist-info → scaevola-1.1.2.dist-info}/METADATA +1 -1
- scaevola-1.1.2.dist-info/RECORD +13 -0
- scaevola-1.1.1.dist-info/RECORD +0 -13
- {scaevola-1.1.1.dist-info → scaevola-1.1.2.dist-info}/WHEEL +0 -0
- {scaevola-1.1.1.dist-info → scaevola-1.1.2.dist-info}/licenses/LICENSE.txt +0 -0
- {scaevola-1.1.1.dist-info → scaevola-1.1.2.dist-info}/top_level.txt +0 -0
scaevola/core/__init__.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import builtins
|
|
1
2
|
import enum
|
|
2
3
|
import functools
|
|
3
4
|
import operator
|
|
@@ -20,35 +21,6 @@ class Util(enum.Enum):
|
|
|
20
21
|
ans: dict = tomllib.loads(text)
|
|
21
22
|
return ans
|
|
22
23
|
|
|
23
|
-
@functools.cached_property
|
|
24
|
-
def funcdata(self: Self) -> dict:
|
|
25
|
-
"This cached property holds the data for easy function making."
|
|
26
|
-
ans: dict = dict()
|
|
27
|
-
name: str
|
|
28
|
-
doc: str
|
|
29
|
-
inner: Callable
|
|
30
|
-
name = "__ge__"
|
|
31
|
-
doc = self.data["docs"]["ge"]
|
|
32
|
-
inner = operator.le
|
|
33
|
-
ans[name] = dict(doc=doc, inner=inner)
|
|
34
|
-
name = "__gt__"
|
|
35
|
-
doc = self.data["docs"]["gt"]
|
|
36
|
-
inner = operator.lt
|
|
37
|
-
ans[name] = dict(doc=doc, inner=inner)
|
|
38
|
-
name = "__rdivmod__"
|
|
39
|
-
doc = self.data["docs"]["rdivmod"]
|
|
40
|
-
inner = divmod
|
|
41
|
-
ans[name] = dict(doc=doc, inner=inner)
|
|
42
|
-
x: Any
|
|
43
|
-
y: Any
|
|
44
|
-
for x, y in self.data["operator"].items():
|
|
45
|
-
name = "__r%s__" % x.rstrip("_")
|
|
46
|
-
doc = self.data["docs"]["operator"] % y
|
|
47
|
-
inner = getattr(operator, x)
|
|
48
|
-
ans[name] = dict(doc=doc, inner=inner)
|
|
49
|
-
ans = dict(sorted(ans.items()))
|
|
50
|
-
return ans
|
|
51
|
-
|
|
52
24
|
|
|
53
25
|
def auto(cls: type) -> type:
|
|
54
26
|
"This decorator implements all the righthand functions."
|
|
@@ -61,18 +33,24 @@ def auto(cls: type) -> type:
|
|
|
61
33
|
|
|
62
34
|
def getfuncnames() -> list[str]:
|
|
63
35
|
"This function returns the names of all righthand functions."
|
|
64
|
-
return list(Util.util.
|
|
36
|
+
return list(Util.util.data.keys())
|
|
65
37
|
|
|
66
38
|
|
|
67
39
|
def makefunc(cls: type, name: str) -> types.FunctionType:
|
|
68
40
|
"This function implements a certain righthand function."
|
|
69
|
-
|
|
41
|
+
funcname: str = Util.util.data[name]["func"]
|
|
42
|
+
module: Any
|
|
43
|
+
if Util.util.data[name].get("isbuiltin", False):
|
|
44
|
+
module = builtins
|
|
45
|
+
else:
|
|
46
|
+
module = operator
|
|
47
|
+
inner: Callable = getattr(module, funcname)
|
|
70
48
|
|
|
71
49
|
def outer(self: Self, other: Any) -> Any:
|
|
72
50
|
"This docstring will be overwritten."
|
|
73
51
|
return inner(type(self)(other), self)
|
|
74
52
|
|
|
75
|
-
outer.__doc__ = Util.util.
|
|
53
|
+
outer.__doc__ = Util.util.data[name]["doc"]
|
|
76
54
|
outer.__module__ = cls.__module__
|
|
77
55
|
outer.__name__ = name
|
|
78
56
|
outer.__qualname__ = cls.__qualname__ + "." + name
|
|
@@ -82,4 +60,4 @@ def makefunc(cls: type, name: str) -> types.FunctionType:
|
|
|
82
60
|
|
|
83
61
|
@auto
|
|
84
62
|
class Scaevola:
|
|
85
|
-
|
|
63
|
+
__slots__ = ()
|
scaevola/core/cfg.toml
CHANGED
|
@@ -1,20 +1,64 @@
|
|
|
1
|
-
[
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
[__ge__]
|
|
2
|
+
doc = "This magic method implements self>=other."
|
|
3
|
+
func = "le"
|
|
4
|
+
|
|
5
|
+
[__gt__]
|
|
6
|
+
doc = "This magic method implements self>other."
|
|
7
|
+
func = "lt"
|
|
8
|
+
|
|
9
|
+
[__radd__]
|
|
10
|
+
doc = "This magic method implements other+self."
|
|
11
|
+
func = "add"
|
|
12
|
+
|
|
13
|
+
[__rand__]
|
|
14
|
+
doc = "This magic method implements other&self."
|
|
15
|
+
func = "and_"
|
|
16
|
+
|
|
17
|
+
[__rdivmod__]
|
|
18
|
+
doc = "This magic method implements divmod(other, self)."
|
|
19
|
+
func = "divmod"
|
|
20
|
+
isbuiltin = true
|
|
21
|
+
|
|
22
|
+
[__rfloordiv__]
|
|
23
|
+
doc = "This magic method implements other//self."
|
|
24
|
+
func = "floordiv"
|
|
25
|
+
|
|
26
|
+
[__rlshift__]
|
|
27
|
+
doc = "This magic method implements other<<self."
|
|
28
|
+
func = "lshift"
|
|
29
|
+
|
|
30
|
+
[__rmatmul__]
|
|
31
|
+
doc = "This magic method implements other@self."
|
|
32
|
+
func = "matmul"
|
|
33
|
+
|
|
34
|
+
[__rmod__]
|
|
35
|
+
doc = "This magic method implements other%self."
|
|
36
|
+
func = "mod"
|
|
37
|
+
|
|
38
|
+
[__rmul__]
|
|
39
|
+
doc = "This magic method implements other*self."
|
|
40
|
+
func = "mul"
|
|
41
|
+
|
|
42
|
+
[__ror__]
|
|
43
|
+
doc = "This magic method implements other|self."
|
|
44
|
+
func = "or_"
|
|
45
|
+
|
|
46
|
+
[__rpow__]
|
|
47
|
+
doc = "This magic method implements other**self."
|
|
48
|
+
func = "pow"
|
|
49
|
+
|
|
50
|
+
[__rrshift__]
|
|
51
|
+
doc = "This magic method implements other>>self."
|
|
52
|
+
func = "rshift"
|
|
53
|
+
|
|
54
|
+
[__rsub__]
|
|
55
|
+
doc = "This magic method implements other-self."
|
|
56
|
+
func = "sub"
|
|
57
|
+
|
|
58
|
+
[__rtruediv__]
|
|
59
|
+
doc = "This magic method implements other/self."
|
|
60
|
+
func = "truediv"
|
|
61
|
+
|
|
62
|
+
[__rxor__]
|
|
63
|
+
doc = "This magic method implements other^self."
|
|
64
|
+
func = "xor"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
scaevola/__init__.py,sha256=KAt5tVgdikLvbdauzJTkCsxH3vJKrff4LB1CH8OklYM,57
|
|
2
|
+
scaevola/core/__init__.py,sha256=Yoec7qOc7la05gV4W4ukHRwUgnBMh_xYbDVz8m827Fw,1641
|
|
3
|
+
scaevola/core/cfg.toml,sha256=MxxrKOsUHCdOA9pAu3bdj-d7whfqES9a9WmAP0pCbyc,1250
|
|
4
|
+
scaevola/tests/__init__.py,sha256=QhiVlxbRnZlt4CSCc4yAPIRHo-BVzKpxzl80CmZC_Js,256
|
|
5
|
+
scaevola/tests/test_doc.py,sha256=xoDCYFUo2WQAiPcW4Z00DBWXjJRrO-X7yHGoCfA_5pc,972
|
|
6
|
+
scaevola/tests/test_op.py,sha256=wiI2TG-j3dVtMwShTmZ9ST6qAVMJDbW499FDePLrZJM,5136
|
|
7
|
+
scaevola/tests/test_slots_Scaevola.py,sha256=xoepOL6PGnKog0zmcyHJyXtrUnmhZoTjX1xFUAxPags,581
|
|
8
|
+
scaevola/tests/test_slots_auto.py,sha256=fMzYrndB2Tp5_iLtCHYVYoBM5KnYHY8VLFoeTcW3wgg,639
|
|
9
|
+
scaevola-1.1.2.dist-info/licenses/LICENSE.txt,sha256=QwqYepQwTN5xG57cngKt6xxYD9z9hw9d3lcI8zSLiNg,1074
|
|
10
|
+
scaevola-1.1.2.dist-info/METADATA,sha256=b-2ZgGjjwcFt-00LbMdGGopbgrXZe418qO6TXCSahcw,2333
|
|
11
|
+
scaevola-1.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
12
|
+
scaevola-1.1.2.dist-info/top_level.txt,sha256=1oM62lKpwPWVxHtGCB2tN-TIs0bzZaSkB9dlI3Eoesw,9
|
|
13
|
+
scaevola-1.1.2.dist-info/RECORD,,
|
scaevola-1.1.1.dist-info/RECORD
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
scaevola/__init__.py,sha256=KAt5tVgdikLvbdauzJTkCsxH3vJKrff4LB1CH8OklYM,57
|
|
2
|
-
scaevola/core/__init__.py,sha256=ip5txpkAK0Hj_cZHEYBHSJf6aTujGV-1-NJECGqk9Lk,2424
|
|
3
|
-
scaevola/core/cfg.toml,sha256=-5qioZv_Ha7PJZ8lRhf9-aYXnane04ohSAeduzIMP0o,386
|
|
4
|
-
scaevola/tests/__init__.py,sha256=QhiVlxbRnZlt4CSCc4yAPIRHo-BVzKpxzl80CmZC_Js,256
|
|
5
|
-
scaevola/tests/test_doc.py,sha256=xoDCYFUo2WQAiPcW4Z00DBWXjJRrO-X7yHGoCfA_5pc,972
|
|
6
|
-
scaevola/tests/test_op.py,sha256=wiI2TG-j3dVtMwShTmZ9ST6qAVMJDbW499FDePLrZJM,5136
|
|
7
|
-
scaevola/tests/test_slots_Scaevola.py,sha256=kzw-LBvn2kH_2n6f2E4M14I04PFt8zGdfdYnRFJYVWo,634
|
|
8
|
-
scaevola/tests/test_slots_auto.py,sha256=fMzYrndB2Tp5_iLtCHYVYoBM5KnYHY8VLFoeTcW3wgg,639
|
|
9
|
-
scaevola-1.1.1.dist-info/licenses/LICENSE.txt,sha256=QwqYepQwTN5xG57cngKt6xxYD9z9hw9d3lcI8zSLiNg,1074
|
|
10
|
-
scaevola-1.1.1.dist-info/METADATA,sha256=pgPQ7jiEuWJqRX_kYfNQ55APOMaOk-H8iKMqItavT4I,2333
|
|
11
|
-
scaevola-1.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
12
|
-
scaevola-1.1.1.dist-info/top_level.txt,sha256=1oM62lKpwPWVxHtGCB2tN-TIs0bzZaSkB9dlI3Eoesw,9
|
|
13
|
-
scaevola-1.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|