dycw-utilities 0.125.14__py3-none-any.whl → 0.125.16__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dycw-utilities
3
- Version: 0.125.14
3
+ Version: 0.125.16
4
4
  Author-email: Derek Wan <d.wan@icloud.com>
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.12
@@ -1,6 +1,6 @@
1
- utilities/__init__.py,sha256=FUi2dI2qq8_0UHJ0RQEHLRzzmOO3YY-SHiWkJPnb-P4,61
1
+ utilities/__init__.py,sha256=_Jk4nXvJPOIX38g8WhJA-81T9Lr_sSEU7Sp5uNotGcs,61
2
2
  utilities/altair.py,sha256=Gpja-flOo-Db0PIPJLJsgzAlXWoKUjPU1qY-DQ829ek,9156
3
- utilities/asyncio.py,sha256=UUcMb_QT4g4-EW0qIoiSENu8x6Fcjn5_X-vvbMrLBfE,50658
3
+ utilities/asyncio.py,sha256=D1o5dwq1y17Nk5tzeDyw5vAwxzqdy9WMY5u-uA6NMPw,50716
4
4
  utilities/atomicwrites.py,sha256=geFjn9Pwn-tTrtoGjDDxWli9NqbYfy3gGL6ZBctiqSo,5393
5
5
  utilities/atools.py,sha256=IYMuFSFGSKyuQmqD6v5IUtDlz8PPw0Sr87Cub_gRU3M,1168
6
6
  utilities/cachetools.py,sha256=C1zqOg7BYz0IfQFK8e3qaDDgEZxDpo47F15RTfJM37Q,2910
@@ -88,7 +88,7 @@ utilities/warnings.py,sha256=un1LvHv70PU-LLv8RxPVmugTzDJkkGXRMZTE2-fTQHw,1771
88
88
  utilities/whenever.py,sha256=jS31ZAY5OMxFxLja_Yo5Fidi87Pd-GoVZ7Vi_teqVDA,16743
89
89
  utilities/zipfile.py,sha256=24lQc9ATcJxHXBPc_tBDiJk48pWyRrlxO2fIsFxU0A8,699
90
90
  utilities/zoneinfo.py,sha256=-5j7IQ9nb7gR43rdgA7ms05im-XuqhAk9EJnQBXxCoQ,1874
91
- dycw_utilities-0.125.14.dist-info/METADATA,sha256=ptsWeHCzCc0Tmvlmzovy3NZ4PLYMSEeT8VdauAv3b0k,12852
92
- dycw_utilities-0.125.14.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
93
- dycw_utilities-0.125.14.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
94
- dycw_utilities-0.125.14.dist-info/RECORD,,
91
+ dycw_utilities-0.125.16.dist-info/METADATA,sha256=9y-tFV-n1PnxG6amsUhKiEKegf9t4ijGRLU6bSBhxsE,12852
92
+ dycw_utilities-0.125.16.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
93
+ dycw_utilities-0.125.16.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
94
+ dycw_utilities-0.125.16.dist-info/RECORD,,
utilities/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.125.14"
3
+ __version__ = "0.125.16"
utilities/asyncio.py CHANGED
@@ -795,13 +795,9 @@ class Looper(Generic[_T]):
795
795
  assert_never(never)
796
796
 
797
797
  def __await__(self) -> Any:
798
- match self._task:
799
- case None:
800
- raise _LooperNoTaskError(looper=self)
801
- case Task() as task:
802
- return task.__await__()
803
- case _ as never:
804
- assert_never(never)
798
+ if (task := self._task) is None: # cannot use match
799
+ raise _LooperNoTaskError(looper=self)
800
+ return task.__await__()
805
801
 
806
802
  def __len__(self) -> int:
807
803
  return self._queue.qsize()
@@ -1144,6 +1140,11 @@ class Looper(Generic[_T]):
1144
1140
  async def _tear_down_core(self) -> None:
1145
1141
  """Core part of tearing down the looper."""
1146
1142
 
1143
+ @property
1144
+ def with_auto_start(self) -> Self:
1145
+ """Replace the auto start flag of the looper."""
1146
+ return self.replace(auto_start=True)
1147
+
1147
1148
  def _yield_sub_loopers(self) -> Iterator[Looper]:
1148
1149
  """Yield all sub-loopers."""
1149
1150
  yield from []