v440 2.0.0.dev176__tar.gz → 2.0.0.dev178__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.dev176/src/v440.egg-info → v440-2.0.0.dev178}/PKG-INFO +1 -1
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/pyproject.toml +1 -1
- v440-2.0.0.dev178/src/v440/_utils/releaseparse/getting.py +25 -0
- v440-2.0.0.dev178/src/v440/_utils/releaseparse/ranging.py +44 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178/src/v440.egg-info}/PKG-INFO +1 -1
- v440-2.0.0.dev176/src/v440/_utils/releaseparse/getting.py +0 -37
- v440-2.0.0.dev176/src/v440/_utils/releaseparse/ranging.py +0 -46
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/LICENSE.txt +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/MANIFEST.in +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/README.rst +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/setup.cfg +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/__init__.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/_utils/BaseStringer.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/_utils/Cfg.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/_utils/ListStringer.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/_utils/Pattern.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/_utils/SlotStringer.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/_utils/__init__.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/_utils/cfg.toml +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/_utils/guarding.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/_utils/releaseparse/__init__.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/_utils/releaseparse/deleting.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/_utils/releaseparse/numerals.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/_utils/releaseparse/setting.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/core/Base.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/core/Local.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/core/Public.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/core/Qual.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/core/Release.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/core/Version.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/core/VersionError.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/core/__init__.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/tests/__init__.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/tests/test_testdata.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/tests/test_version.py +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440/tests/testdata.toml +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440.egg-info/SOURCES.txt +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440.egg-info/dependency_links.txt +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440.egg-info/requires.txt +0 -0
- {v440-2.0.0.dev176 → v440-2.0.0.dev178}/src/v440.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import operator
|
|
4
|
+
from functools import partial
|
|
5
|
+
from typing import *
|
|
6
|
+
|
|
7
|
+
from v440._utils.releaseparse import ranging
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def getitem(data: tuple, key: SupportsIndex | slice) -> list:
|
|
11
|
+
ans: int | tuple
|
|
12
|
+
if type(key) is slice:
|
|
13
|
+
r: range = ranging.torange(key, len(data))
|
|
14
|
+
f: partial = partial(getitem_int, data)
|
|
15
|
+
ans = list(map(f, r))
|
|
16
|
+
else:
|
|
17
|
+
ans = getitem_int(data, operator.index(key))
|
|
18
|
+
return ans
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def getitem_int(data: tuple[int], key: int) -> int:
|
|
22
|
+
if key < len(data):
|
|
23
|
+
return data[key]
|
|
24
|
+
else:
|
|
25
|
+
return 0
|
|
@@ -0,0 +1,44 @@
|
|
|
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, bwd=step < 0)
|
|
12
|
+
stop: int = calcstop(key.stop, length=length, bwd=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, bwd: bool) -> int:
|
|
24
|
+
if value is None:
|
|
25
|
+
if bwd:
|
|
26
|
+
return length - 1
|
|
27
|
+
else:
|
|
28
|
+
return 0
|
|
29
|
+
ans: int = operator.index(value)
|
|
30
|
+
if ans >= 0:
|
|
31
|
+
return ans
|
|
32
|
+
return max(-bwd, ans + length)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def calcstop(value: Optional[SupportsIndex], *, length: int, bwd: bool) -> int:
|
|
36
|
+
if value is None:
|
|
37
|
+
if bwd:
|
|
38
|
+
return -1
|
|
39
|
+
else:
|
|
40
|
+
return length
|
|
41
|
+
ans: int = operator.index(value)
|
|
42
|
+
if ans >= 0:
|
|
43
|
+
return ans
|
|
44
|
+
return max(-bwd, ans + length)
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import operator
|
|
4
|
-
from functools import partial
|
|
5
|
-
from typing import *
|
|
6
|
-
|
|
7
|
-
from overloadable import Overloadable
|
|
8
|
-
|
|
9
|
-
from v440._utils.releaseparse import ranging
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@Overloadable
|
|
13
|
-
def getitem(data: tuple, key: Any) -> bool:
|
|
14
|
-
return type(key) is slice
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@getitem.overload(False)
|
|
18
|
-
def getitem(data: tuple, key: Any) -> int:
|
|
19
|
-
i: int = operator.index(key)
|
|
20
|
-
ans: int = getitem_int(data, i)
|
|
21
|
-
return ans
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@getitem.overload(True)
|
|
25
|
-
def getitem(data: tuple, key: Any) -> list:
|
|
26
|
-
r: range = ranging.torange(key, len(data))
|
|
27
|
-
f: partial = partial(getitem_int, data)
|
|
28
|
-
m: map = map(f, r)
|
|
29
|
-
ans: list = list(m)
|
|
30
|
-
return ans
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def getitem_int(data: tuple[int], key: int) -> int:
|
|
34
|
-
if key < len(data):
|
|
35
|
-
return data[key]
|
|
36
|
-
else:
|
|
37
|
-
return 0
|
|
@@ -1,46 +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: 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
|
|
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
|