StructResult 0.2.0__tar.gz → 0.3.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: StructResult
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: structural result with exception
5
5
  Author-email: Serj Kotilevski <youserj@outlook.com>
6
6
  Project-URL: Source, https://github.com/youserj/Result_prj
@@ -9,7 +9,7 @@ where = ["src"]
9
9
 
10
10
  [project]
11
11
  name = "StructResult"
12
- version = "0.2.0"
12
+ version = "0.3.0"
13
13
  requires-python = ">= 3.12"
14
14
  authors = [
15
15
  {name="Serj Kotilevski", email="youserj@outlook.com"}
@@ -8,9 +8,9 @@ class Result(Generic[T]):
8
8
  err: Optional[list[Exception]]
9
9
  __slots__ = ("value", "err")
10
10
 
11
- def __init__(self, value: T):
11
+ def __init__(self, value: T, err: list[Exception] = None):
12
12
  self.value = value
13
- self.err = None
13
+ self.err = err
14
14
 
15
15
  def __getitem__(self, item):
16
16
  if item == 0:
@@ -24,3 +24,8 @@ class Result(Generic[T]):
24
24
  if self.err is None:
25
25
  self.err = list()
26
26
  self.err.append(e)
27
+
28
+ def extend_err(self, e: list[Exception]):
29
+ if self.err is None:
30
+ self.err = list()
31
+ self.err.extend(e)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: StructResult
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: structural result with exception
5
5
  Author-email: Serj Kotilevski <youserj@outlook.com>
6
6
  Project-URL: Source, https://github.com/youserj/Result_prj
File without changes
File without changes