mm-std 0.4.6__py3-none-any.whl → 0.4.8__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.
@@ -57,10 +57,10 @@ class HttpResponse:
57
57
  def is_err(self) -> bool:
58
58
  return self.error is not None or (self.status_code is not None and self.status_code >= 400)
59
59
 
60
- def to_err_result[T](self, error: str | Exception | tuple[str, Exception] | None = None) -> Result[T]:
60
+ def to_err[T](self, error: str | Exception | tuple[str, Exception] | None = None) -> Result[T]:
61
61
  return Result.err(error or self.error or "error", extra=self.to_dict())
62
62
 
63
- def to_ok_result[T](self, value: T) -> Result[T]:
63
+ def to_ok[T](self, value: T) -> Result[T]:
64
64
  return Result.ok(value, extra=self.to_dict())
65
65
 
66
66
  def to_dict(self) -> dict[str, Any]:
mm_std/result.py CHANGED
@@ -79,7 +79,7 @@ class Result[T]:
79
79
  return self.exception
80
80
  raise RuntimeError("No exception provided")
81
81
 
82
- def ok_or_error(self) -> T | str:
82
+ def value_or_error(self) -> T | str:
83
83
  """
84
84
  Returns the success value if available, otherwise returns the error message.
85
85
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mm-std
3
- Version: 0.4.6
3
+ Version: 0.4.8
4
4
  Requires-Python: >=3.12
5
5
  Requires-Dist: aiohttp-socks~=0.10.1
6
6
  Requires-Dist: aiohttp~=3.11.16
@@ -12,7 +12,7 @@ mm_std/net.py,sha256=qdRCBIDneip6FaPNe5mx31UtYVmzqam_AoUF7ydEyjA,590
12
12
  mm_std/print_.py,sha256=zB7sVbSSF8RffMxvnOdbKCXjCKtKzKV3R68pBri4NkQ,1638
13
13
  mm_std/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  mm_std/random_.py,sha256=OuUX4VJeSd13NZBya4qrGpR2TfN7_87tfebOY6DBUnI,1113
15
- mm_std/result.py,sha256=ZeGL5juBLdrlYiNgI89K50W_pNn35IOVE71sdfV_1uo,8800
15
+ mm_std/result.py,sha256=FaeFo63iCBB8KurSPAx6rnB8-36u_TlLsncFYIeHZ24,8803
16
16
  mm_std/str.py,sha256=BEjJ1p5O4-uSYK0h-enasSSDdwzkBbiwdQ4_dsrlEE8,3257
17
17
  mm_std/toml.py,sha256=CNznWKR0bpOxS6e3VB5LGS-Oa9lW-wterkcPUFtPcls,610
18
18
  mm_std/types_.py,sha256=9FGd2q47a8M9QQgsWJR1Kq34jLxBAkYSoJuwih4PPqg,257
@@ -27,7 +27,7 @@ mm_std/concurrency/sync_task_runner.py,sha256=s5JPlLYLGQGHIxy4oDS-PN7O9gcy-yPZFo
27
27
  mm_std/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  mm_std/http/http_request.py,sha256=VnjZKrfaXQfMxrHRUqQ-Sxtr5Qf9FXBiJ-mmJTCzNkY,3709
29
29
  mm_std/http/http_request_sync.py,sha256=bqCBilbe4ZJ9vkhuBQeU5UMTJh6BtvtUwjieEodu6rw,1542
30
- mm_std/http/http_response.py,sha256=3m9gg1O0yEo7n8p3-FO_Scicr49gU5e8uRmYHiH_4Ig,3898
31
- mm_std-0.4.6.dist-info/METADATA,sha256=QwjIOyDK1IT_1z06G3LVq26Hvj902aDE7yi1FgaY0o4,446
32
- mm_std-0.4.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
33
- mm_std-0.4.6.dist-info/RECORD,,
30
+ mm_std/http/http_response.py,sha256=vrRv7Rjr5_kTUGllfW5oJ8ZqkcfiXc9T8PlBGAr-TBM,3884
31
+ mm_std-0.4.8.dist-info/METADATA,sha256=DYv-E1MxynhsDPngxSjO7EVcj0rZ7ZUaBlhDrGxv1Uc,446
32
+ mm_std-0.4.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
33
+ mm_std-0.4.8.dist-info/RECORD,,
File without changes