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.
Files changed (40) hide show
  1. {v440-2.0.0.dev145/src/v440.egg-info → v440-2.0.0.dev147}/PKG-INFO +1 -1
  2. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/pyproject.toml +1 -1
  3. v440-2.0.0.dev147/src/v440/_utils/releaseparse/ranging.py +46 -0
  4. {v440-2.0.0.dev145 → v440-2.0.0.dev147/src/v440.egg-info}/PKG-INFO +1 -1
  5. v440-2.0.0.dev145/src/v440/_utils/releaseparse/ranging.py +0 -37
  6. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/LICENSE.txt +0 -0
  7. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/MANIFEST.in +0 -0
  8. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/README.rst +0 -0
  9. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/setup.cfg +0 -0
  10. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/__init__.py +0 -0
  11. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/BaseStringer.py +0 -0
  12. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/Cfg.py +0 -0
  13. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/ListStringer.py +0 -0
  14. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/Pattern.py +0 -0
  15. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/SlotStringer.py +0 -0
  16. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/__init__.py +0 -0
  17. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/cfg.toml +0 -0
  18. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/guarding.py +0 -0
  19. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/releaseparse/__init__.py +0 -0
  20. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/releaseparse/deleting.py +0 -0
  21. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/releaseparse/getting.py +0 -0
  22. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/releaseparse/listing.py +0 -0
  23. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/releaseparse/numerals.py +0 -0
  24. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/_utils/releaseparse/setting.py +0 -0
  25. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/core/Base.py +0 -0
  26. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/core/Local.py +0 -0
  27. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/core/Public.py +0 -0
  28. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/core/Qual.py +0 -0
  29. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/core/Release.py +0 -0
  30. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/core/Version.py +0 -0
  31. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/core/VersionError.py +0 -0
  32. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/core/__init__.py +0 -0
  33. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/tests/__init__.py +0 -0
  34. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/tests/test_testdata.py +0 -0
  35. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/tests/test_version.py +0 -0
  36. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440/tests/testdata.toml +0 -0
  37. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440.egg-info/SOURCES.txt +0 -0
  38. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440.egg-info/dependency_links.txt +0 -0
  39. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440.egg-info/requires.txt +0 -0
  40. {v440-2.0.0.dev145 → v440-2.0.0.dev147}/src/v440.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: v440
3
- Version: 2.0.0.dev145
3
+ Version: 2.0.0.dev147
4
4
  Summary: This project provides mutable version objects in accordance with PEP440.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License: The MIT License (MIT)
@@ -36,7 +36,7 @@ keywords = []
36
36
  name = "v440"
37
37
  readme = "README.rst"
38
38
  requires-python = ">=3.11"
39
- version = "2.0.0.dev145"
39
+ version = "2.0.0.dev147"
40
40
 
41
41
  [project.license]
42
42
  file = "LICENSE.txt"
@@ -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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: v440
3
- Version: 2.0.0.dev145
3
+ Version: 2.0.0.dev147
4
4
  Summary: This project provides mutable version objects in accordance with PEP440.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License: The MIT License (MIT)
@@ -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