scaevola 1.1.2__py3-none-any.whl → 1.1.3__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 -6
- scaevola/core/cfg.toml +0 -16
- {scaevola-1.1.2.dist-info → scaevola-1.1.3.dist-info}/METADATA +2 -1
- {scaevola-1.1.2.dist-info → scaevola-1.1.3.dist-info}/RECORD +7 -7
- {scaevola-1.1.2.dist-info → scaevola-1.1.3.dist-info}/WHEEL +1 -1
- {scaevola-1.1.2.dist-info → scaevola-1.1.3.dist-info}/licenses/LICENSE.txt +0 -0
- {scaevola-1.1.2.dist-info → scaevola-1.1.3.dist-info}/top_level.txt +0 -0
scaevola/core/__init__.py
CHANGED
|
@@ -7,19 +7,22 @@ import types
|
|
|
7
7
|
from importlib import resources
|
|
8
8
|
from typing import *
|
|
9
9
|
|
|
10
|
+
import setdoc
|
|
11
|
+
|
|
10
12
|
__all__ = ["Scaevola", "auto", "getfuncnames", "makefunc"]
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
class Util(enum.Enum):
|
|
14
16
|
"This enum provides a singleton."
|
|
17
|
+
|
|
15
18
|
util = None
|
|
16
19
|
|
|
17
20
|
@functools.cached_property
|
|
18
21
|
def data(self: Self) -> dict:
|
|
19
22
|
"This cached property holds the cfg data."
|
|
20
|
-
text: str
|
|
21
|
-
|
|
22
|
-
return
|
|
23
|
+
text: str
|
|
24
|
+
text = resources.read_text("scaevola.core", "cfg.toml")
|
|
25
|
+
return tomllib.loads(text)
|
|
23
26
|
|
|
24
27
|
|
|
25
28
|
def auto(cls: type) -> type:
|
|
@@ -38,22 +41,24 @@ def getfuncnames() -> list[str]:
|
|
|
38
41
|
|
|
39
42
|
def makefunc(cls: type, name: str) -> types.FunctionType:
|
|
40
43
|
"This function implements a certain righthand function."
|
|
41
|
-
funcname: str
|
|
44
|
+
funcname: str
|
|
45
|
+
inner: Callable
|
|
42
46
|
module: Any
|
|
47
|
+
funcname = Util.util.data[name]["func"]
|
|
43
48
|
if Util.util.data[name].get("isbuiltin", False):
|
|
44
49
|
module = builtins
|
|
45
50
|
else:
|
|
46
51
|
module = operator
|
|
47
|
-
inner
|
|
52
|
+
inner = getattr(module, funcname)
|
|
48
53
|
|
|
49
54
|
def outer(self: Self, other: Any) -> Any:
|
|
50
55
|
"This docstring will be overwritten."
|
|
51
56
|
return inner(type(self)(other), self)
|
|
52
57
|
|
|
53
|
-
outer.__doc__ = Util.util.data[name]["doc"]
|
|
54
58
|
outer.__module__ = cls.__module__
|
|
55
59
|
outer.__name__ = name
|
|
56
60
|
outer.__qualname__ = cls.__qualname__ + "." + name
|
|
61
|
+
setdoc.basic(outer)
|
|
57
62
|
setattr(cls, name, outer)
|
|
58
63
|
return outer
|
|
59
64
|
|
scaevola/core/cfg.toml
CHANGED
|
@@ -1,64 +1,48 @@
|
|
|
1
1
|
[__ge__]
|
|
2
|
-
doc = "This magic method implements self>=other."
|
|
3
2
|
func = "le"
|
|
4
3
|
|
|
5
4
|
[__gt__]
|
|
6
|
-
doc = "This magic method implements self>other."
|
|
7
5
|
func = "lt"
|
|
8
6
|
|
|
9
7
|
[__radd__]
|
|
10
|
-
doc = "This magic method implements other+self."
|
|
11
8
|
func = "add"
|
|
12
9
|
|
|
13
10
|
[__rand__]
|
|
14
|
-
doc = "This magic method implements other&self."
|
|
15
11
|
func = "and_"
|
|
16
12
|
|
|
17
13
|
[__rdivmod__]
|
|
18
|
-
doc = "This magic method implements divmod(other, self)."
|
|
19
14
|
func = "divmod"
|
|
20
15
|
isbuiltin = true
|
|
21
16
|
|
|
22
17
|
[__rfloordiv__]
|
|
23
|
-
doc = "This magic method implements other//self."
|
|
24
18
|
func = "floordiv"
|
|
25
19
|
|
|
26
20
|
[__rlshift__]
|
|
27
|
-
doc = "This magic method implements other<<self."
|
|
28
21
|
func = "lshift"
|
|
29
22
|
|
|
30
23
|
[__rmatmul__]
|
|
31
|
-
doc = "This magic method implements other@self."
|
|
32
24
|
func = "matmul"
|
|
33
25
|
|
|
34
26
|
[__rmod__]
|
|
35
|
-
doc = "This magic method implements other%self."
|
|
36
27
|
func = "mod"
|
|
37
28
|
|
|
38
29
|
[__rmul__]
|
|
39
|
-
doc = "This magic method implements other*self."
|
|
40
30
|
func = "mul"
|
|
41
31
|
|
|
42
32
|
[__ror__]
|
|
43
|
-
doc = "This magic method implements other|self."
|
|
44
33
|
func = "or_"
|
|
45
34
|
|
|
46
35
|
[__rpow__]
|
|
47
|
-
doc = "This magic method implements other**self."
|
|
48
36
|
func = "pow"
|
|
49
37
|
|
|
50
38
|
[__rrshift__]
|
|
51
|
-
doc = "This magic method implements other>>self."
|
|
52
39
|
func = "rshift"
|
|
53
40
|
|
|
54
41
|
[__rsub__]
|
|
55
|
-
doc = "This magic method implements other-self."
|
|
56
42
|
func = "sub"
|
|
57
43
|
|
|
58
44
|
[__rtruediv__]
|
|
59
|
-
doc = "This magic method implements other/self."
|
|
60
45
|
func = "truediv"
|
|
61
46
|
|
|
62
47
|
[__rxor__]
|
|
63
|
-
doc = "This magic method implements other^self."
|
|
64
48
|
func = "xor"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scaevola
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.3
|
|
4
4
|
Summary: This project provides a class with preset right handed magic methods.
|
|
5
5
|
Author-email: Johannes <johannes.programming@gmail.com>
|
|
6
6
|
License: The MIT License (MIT)
|
|
@@ -39,6 +39,7 @@ Classifier: Typing :: Typed
|
|
|
39
39
|
Requires-Python: >=3.11
|
|
40
40
|
Description-Content-Type: text/x-rst
|
|
41
41
|
License-File: LICENSE.txt
|
|
42
|
+
Requires-Dist: setdoc<2,>=1.2.8
|
|
42
43
|
Dynamic: license-file
|
|
43
44
|
|
|
44
45
|
========
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
scaevola/__init__.py,sha256=KAt5tVgdikLvbdauzJTkCsxH3vJKrff4LB1CH8OklYM,57
|
|
2
|
-
scaevola/core/__init__.py,sha256=
|
|
3
|
-
scaevola/core/cfg.toml,sha256=
|
|
2
|
+
scaevola/core/__init__.py,sha256=U7yuLFvqFpCQLqJ8l5yM_CvwlGhEfoU9hvMJXdbEu8s,1645
|
|
3
|
+
scaevola/core/cfg.toml,sha256=VyO3LrEmEECCJdQa-WrQ_HWLlIGn_MWtdSD0QWEFF1g,452
|
|
4
4
|
scaevola/tests/__init__.py,sha256=QhiVlxbRnZlt4CSCc4yAPIRHo-BVzKpxzl80CmZC_Js,256
|
|
5
5
|
scaevola/tests/test_doc.py,sha256=xoDCYFUo2WQAiPcW4Z00DBWXjJRrO-X7yHGoCfA_5pc,972
|
|
6
6
|
scaevola/tests/test_op.py,sha256=wiI2TG-j3dVtMwShTmZ9ST6qAVMJDbW499FDePLrZJM,5136
|
|
7
7
|
scaevola/tests/test_slots_Scaevola.py,sha256=xoepOL6PGnKog0zmcyHJyXtrUnmhZoTjX1xFUAxPags,581
|
|
8
8
|
scaevola/tests/test_slots_auto.py,sha256=fMzYrndB2Tp5_iLtCHYVYoBM5KnYHY8VLFoeTcW3wgg,639
|
|
9
|
-
scaevola-1.1.
|
|
10
|
-
scaevola-1.1.
|
|
11
|
-
scaevola-1.1.
|
|
12
|
-
scaevola-1.1.
|
|
13
|
-
scaevola-1.1.
|
|
9
|
+
scaevola-1.1.3.dist-info/licenses/LICENSE.txt,sha256=QwqYepQwTN5xG57cngKt6xxYD9z9hw9d3lcI8zSLiNg,1074
|
|
10
|
+
scaevola-1.1.3.dist-info/METADATA,sha256=ooVqZXVJDlFTBwUNlZNkCnMUGNyJLn5_vVfwMTLvpFQ,2365
|
|
11
|
+
scaevola-1.1.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
12
|
+
scaevola-1.1.3.dist-info/top_level.txt,sha256=1oM62lKpwPWVxHtGCB2tN-TIs0bzZaSkB9dlI3Eoesw,9
|
|
13
|
+
scaevola-1.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|