python-utils 4.0.1__py3-none-any.whl → 4.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.
- python_utils/aio.py +5 -2
- python_utils/containers.py +537 -41
- python_utils/converters.py +70 -15
- python_utils/decorators.py +29 -3
- python_utils/formatters.py +25 -8
- python_utils/generators.py +82 -34
- python_utils/import_.py +49 -8
- python_utils/logger.py +89 -30
- python_utils/loguru.py +34 -1
- python_utils/time.py +55 -26
- {python_utils-4.0.1.dist-info → python_utils-4.1.0.dist-info}/METADATA +22 -9
- python_utils-4.1.0.dist-info/RECORD +21 -0
- {python_utils-4.0.1.dist-info → python_utils-4.1.0.dist-info}/WHEEL +1 -1
- python_utils-4.0.1.dist-info/RECORD +0 -21
- {python_utils-4.0.1.dist-info → python_utils-4.1.0.dist-info}/licenses/LICENSE +0 -0
python_utils/aio.py
CHANGED
|
@@ -35,7 +35,9 @@ async def acount(
|
|
|
35
35
|
start: First value to yield.
|
|
36
36
|
step: Amount added between successive values.
|
|
37
37
|
delay: Seconds to ``asyncio.sleep`` between yields.
|
|
38
|
-
stop: Exclusive
|
|
38
|
+
stop: Exclusive bound, ``None`` counts forever. It is an upper bound
|
|
39
|
+
for a positive ``step`` and a lower bound for a negative one, the
|
|
40
|
+
way ``range`` reads it.
|
|
39
41
|
|
|
40
42
|
Yields:
|
|
41
43
|
The successive counter values.
|
|
@@ -46,7 +48,8 @@ async def acount(
|
|
|
46
48
|
[0, 1, 2]
|
|
47
49
|
"""
|
|
48
50
|
for item in itertools.count(start, step): # pragma: no branch
|
|
49
|
-
|
|
51
|
+
# A negative step counts down, so `stop` is the lower bound there.
|
|
52
|
+
if stop is not None and (item <= stop if step < 0 else item >= stop):
|
|
50
53
|
break
|
|
51
54
|
|
|
52
55
|
yield item
|