v440 2.0.0.dev145__tar.gz → 2.0.0.dev147__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.
- {v440-2.0.0.dev145/src/v440.egg-info → v440-2.0.0.dev147}/PKG-INFO +1 -1
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/pyproject.toml +1 -1
- v440-2.0.0.dev147/src/v440/_utils/releaseparse/ranging.py +46 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147/src/v440.egg-info}/PKG-INFO +1 -1
- v440-2.0.0.dev145/src/v440/_utils/releaseparse/ranging.py +0 -37
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/LICENSE.txt +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/MANIFEST.in +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/README.rst +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/setup.cfg +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/__init__.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/BaseStringer.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/Cfg.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/ListStringer.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/Pattern.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/SlotStringer.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/__init__.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/cfg.toml +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/guarding.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/releaseparse/__init__.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/releaseparse/deleting.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/releaseparse/getting.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/releaseparse/listing.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/releaseparse/numerals.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/releaseparse/setting.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/core/Base.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/core/Local.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/core/Public.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/core/Qual.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/core/Release.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/core/Version.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/core/VersionError.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/core/__init__.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/tests/__init__.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/tests/test_testdata.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/tests/test_version.py +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/tests/testdata.toml +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440.egg-info/SOURCES.txt +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440.egg-info/dependency_links.txt +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440.egg-info/requires.txt +0 -0
- {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import operator
|
|
4
|
+
from typing import *
|
|
5
|
+
|
|
6
|
+
__all__ = ["torange"]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def torange(key: slice, length: int) -> range:
|
|
10
|
+
step: int = calcstep(key.step)
|
|
11
|
+
start: int = calcstart(key.start, length=length, fwd=step > 0)
|
|
12
|
+
stop: int = calcstop(key.stop, length=length, fwd=step > 0)
|
|
13
|
+
ans: range = range(start, stop, step)
|
|
14
|
+
return ans
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def calcstep(value: Optional[SupportsIndex]) -> int:
|
|
18
|
+
if value is None:
|
|
19
|
+
return 1
|
|
20
|
+
return operator.index(value)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def calcstart(value: Optional[SupportsIndex], *, length: int, fwd: bool) -> int:
|
|
24
|
+
ans: int
|
|
25
|
+
if value is None:
|
|
26
|
+
ans = 0 if fwd else (length - 1)
|
|
27
|
+
else:
|
|
28
|
+
ans = operator.index(value)
|
|
29
|
+
if ans < 0:
|
|
30
|
+
ans += length
|
|
31
|
+
if ans < 0:
|
|
32
|
+
ans = 0 if fwd else -1
|
|
33
|
+
return ans
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def calcstop(value: Optional[SupportsIndex], *, length: int, fwd: bool) -> int:
|
|
37
|
+
ans: int
|
|
38
|
+
if value is None:
|
|
39
|
+
ans = length if fwd else -1
|
|
40
|
+
else:
|
|
41
|
+
ans = operator.index(value)
|
|
42
|
+
if ans < 0:
|
|
43
|
+
ans += length
|
|
44
|
+
if ans < 0:
|
|
45
|
+
ans = 0 if fwd else -1
|
|
46
|
+
return ans
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import operator
|
|
4
|
-
from typing import *
|
|
5
|
-
|
|
6
|
-
__all__ = ["torange"]
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def torange(key: Any, length: Any) -> range:
|
|
10
|
-
start: Any = key.start
|
|
11
|
-
stop: Any = key.stop
|
|
12
|
-
step: Any = key.step
|
|
13
|
-
if step is None:
|
|
14
|
-
step = 1
|
|
15
|
-
else:
|
|
16
|
-
step = operator.index(step)
|
|
17
|
-
if step == 0:
|
|
18
|
-
raise ValueError
|
|
19
|
-
fwd: bool = step > 0
|
|
20
|
-
if start is None:
|
|
21
|
-
start = 0 if fwd else (length - 1)
|
|
22
|
-
else:
|
|
23
|
-
start = operator.index(start)
|
|
24
|
-
if stop is None:
|
|
25
|
-
stop = length if fwd else -1
|
|
26
|
-
else:
|
|
27
|
-
stop = operator.index(stop)
|
|
28
|
-
if start < 0:
|
|
29
|
-
start += length
|
|
30
|
-
if start < 0:
|
|
31
|
-
start = 0 if fwd else -1
|
|
32
|
-
if stop < 0:
|
|
33
|
-
stop += length
|
|
34
|
-
if stop < 0:
|
|
35
|
-
stop = 0 if fwd else -1
|
|
36
|
-
ans: range = range(start, stop, step)
|
|
37
|
-
return ans
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|