StructResult 0.1.0__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.
@@ -0,0 +1 @@
1
+ from .main import Result
StructResult/main.py ADDED
@@ -0,0 +1,21 @@
1
+ from dataclasses import dataclass
2
+ from typing import Any, Optional
3
+
4
+
5
+ @dataclass(slots=True)
6
+ class Result:
7
+ value: Any
8
+ err: Optional[list[Exception]] = None
9
+
10
+ def __getitem__(self, item):
11
+ if item == 0:
12
+ return self.value
13
+ elif item == 1:
14
+ return self.err
15
+ else:
16
+ raise StopIteration
17
+
18
+ def append_err(self, e: Exception):
19
+ if self.err is None:
20
+ self.err = list()
21
+ self.err.append(e)
@@ -0,0 +1,15 @@
1
+ Metadata-Version: 2.2
2
+ Name: StructResult
3
+ Version: 0.1.0
4
+ Summary: structural result with exception
5
+ Author-email: Serj Kotilevski <youserj@outlook.com>
6
+ Project-URL: Source, https://github.com/youserj/Result_prj
7
+ Keywords: result,exception
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.12
12
+ Description-Content-Type: text/markdown
13
+
14
+ # Result_prj
15
+ python return struct
@@ -0,0 +1,6 @@
1
+ StructResult/__init__.py,sha256=HmpVji5o5NBLgFYpjsuZuSTkOIZGpMN54s9iOYd2krg,26
2
+ StructResult/main.py,sha256=PnxAqOj4dhkQ9KuuvTxs4Mj9bS35X2vTaEcvNCLt2pM,495
3
+ StructResult-0.1.0.dist-info/METADATA,sha256=LGXjSnKNJFuc-iCSfTLpgiQ1olI--a94ulVWh2-bfaw,496
4
+ StructResult-0.1.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
5
+ StructResult-0.1.0.dist-info/top_level.txt,sha256=Kpxya2oNyjOxogXuN_JnRenStl5IjQ4T9-ISm7DtqDk,13
6
+ StructResult-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (75.8.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ StructResult